Shopify Show Text on Product Page Based on Tag / Otherwise Hide
Sometimes you may want to show information specific to a product or a line of products. I have been able to achieve this using two separate methods.
Method 1 – Code
Add the following code to your product template file.
{% for tag in product.tags %} {% if product.tags contains "computer" %} Layaway now available {% break %} {% endif %} {% endfor%}
Method 2 – Template
You can easily create a new product template for your specific line of products that need a custom look or text.
Go to “edit code” and Templates folder. Create a new template for type product – example product.computer.liquid
If your theme uses sections, you will need to create a section to go with this new template (where the actual product page content is made). Let’s create product-computer.liquid.
Look in your new template file for code such as
{%section product%}
and replace with your new section name such as
{%section product-computer%]