How can we observe changes in the featured product variant on the homepage? On the product page, we simply observe the URL to detect variant changes, but how can we implement the same functionality for the featured product on the homepage?
Hi Sabin,
Could you explain your usecase here a bit more - what are you hoping to do when a variant is changed in a home page featured product section? One thing you could try is to add a JS event listener that targets the variant picker so you could set up a trigger when a variant is changed.
I want to display the customized product options based on the variant on the product page. So, when the page changes, I need to render the JavaScript to update the options. However, I’m unsure when the variant changes. On the product page, the variant ID changes in the URL when the variant is selected, but on the featured product page, the URL doesn’t change. This is my concern
@Liam-Shopify is there any update?
Did you explore this option:
One thing you could try is to add a JS event listener that targets the variant picker so you could set up a trigger when a variant is changed.