How to Add the data-product-id and/or data-variant-id Attribute to an Element
If a price on your website that is included in your test is not updating in preview mode, or is highlighted in blue, use this guide to resolve it.
Background
Step 1: Inspect the price that is not working
Step 2: Find a unique combination of classes, IDs, and/or attributes

Step 3: Open the code editor in Shopify

Step 4: Search the files

Step 5: Search each .liquid file to find the text
Step 6: Find the closest HTML open tag to the text.
Step 7: Insert a data-product-id and/or data-variant-id snippet.
Last updated
Was this helpful?