Klaviyo BackInStock modal unable to read ID when product variant changes.
I’ve been dealing with some issues related to the Klaviyo backinstock modal and a shopify store. The issue is whenever you load the page, and then select a new product variant (that is out of stock) and click the “Notify me when available” button, you get a “Uncaught TypeError: Cannot read properties of undefined (reading 'id')”.
The interesting thing about this issue is it only happens when you load the page, and then select a variant that is out of stock. If you reload the page with this variant selected, the modal will work fine. I looked into the Klaviyo code and can see that it either selects the ID from the query params in the URL, or from a hidden form field. When i change the product variant, the URL is still averrable to provide the ID.
I’ve tried to reinit Klaviyo all together when the variant is changed, but i am still getting this issue. Has anyone experienced this before?
