Shopify Buttons in Dynamic Lists in Tabs

Hello, @JacobJolibois

It seems that Shopify changed their code for buy-button and now it is different now the one that was when Nelson been showing the tutorial.

But there is still a solution :slight_smile:

In the code snippet from Shopify you will see the ID of the element, where script will apply all information about the product:

Same id you will see a little bit further inside the script:


Since right now all your dynamic elements using this same ID, when the page with products is loading Shopify script renders all products in one place.

For fix this issue you will need to make that ID - unique. So all you need to do is change that ID number on one of the dynamic fields that is unique for each product (product-ID, name, slug, etc.). Then Shopify script will dynamically create separate divs for each product and will not mess it all in one place anymore :slight_smile:

P.S. I used Name field in this example, but then I saw that it may contain few words and spaces sometimes. So, I would recommend using slug or product-id fields instead for avoiding breaking the code structure.

Best regards,
Anna