“Hi everyone! I am trying to add specific Liquid code to individual products, but it keeps showing up on every product page. I’ve heard I need to create separate product templates or use Metafields, but I’m not sure how to do that. Can someone guide me on the best way to handle this?”
Yeah, you’re editing the “Default product” template, which applies to everything.
To fix this, go to your Theme Editor (Customize). At the top center dropdown, select Products → Create template. Name it something like “custom-code”. Add your specific liquid code to this new template and save.
Then, go to the actual Product in your Shopify admin. Scroll down to the “Theme template” section on the bottom right and change it from Default to your new “custom-code” template.
If you have hundreds of products needing different code, metafields are better. But for just a few, custom templates are the way to go.
Hi @maxway_04
Read the friendly manual and follow the steps to try things out
https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates#create-a-new-template
LOT of valuable stuff in there.
This is a classic template vs. metafield decision! The quickest clean solution is creating an alternate product template (e.g. product.special.json) and assigning it only to the products that need it, keeps your code isolated without cluttering your main template.
Metafields work better when the content changes per product but the logic stays the same.
If it gets too technical from here, feel free to let me know, always around to aid! ![]()