Broadcast Theme - Back in stock notification

Hello

This product has one variant OOS.

When i click Notify me when back in stock - the wrong variant is showing

and so the email received is also wrong

How can i remedy to this.

Thanks

1 Like

Looks like the theme does not have code to update this data with variant change.
It’s possible to add it.

  1. Go to 'Customize".
  2. Add a “Custom liquid” block at the bottom of the “Product info” section.
  3. Paste this code:
<script>
  window.addEventListener('load', () => {
    if (!subscribe) return;
    subscribe(theme.PUB_SUB_EVENTS.variantChange, ({data}) => {
      const input = document.getElementById('NotificationFormProduct');
      if (input) input.value = data.variant.name;
    });
  })
</script>

The code will listen to the variant change events generated by the theme code and update notification form data accordingly.


if my post is helpful, please like it ♡ and mark as a solution -- this will help others find it