Change product template

Topic summary

A Shopify store owner needed to apply different product templates for two categories: Clothing and Jewellery. Specifically, they wanted to display a size chart only for clothing items while hiding or removing it from jewellery products.

Solutions Provided:

  • Create separate product templates for each category and assign them accordingly through Shopify’s theme structure
  • Use conditional Liquid code logic based on product type or tags to control when the size chart appears
  • Add custom code to the theme.liquid file that checks if a product belongs to the ‘jewellery_all’ collection and conditionally displays content

Resolution:

The issue was resolved using the conditional code approach. The solution involved adding Liquid template code above the </body> tag in theme.liquid that checks product collections and displays the size chart only for non-jewellery items. The original poster confirmed the solution worked successfully.

Multiple community members provided documentation links and video tutorials for creating and applying templates in Shopify, along with code snippets for implementation.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Hi Everyone,

Hope you’re doing good.

I want to change the template for specific products as I have two categories (Clothing & Jewellery)

I’ve managed to add size chart page for the clothing items. But if I delete this or even hide this for jewellery item

How do I remove it from specific products?

Thank you

Hi @hritikakhattar

You can create 2 product templates and assign them to products in each category

https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates

Hey @hritikakhattar

Share your Store URL and Password if enabled.

Best Regards,

Moeed

Hi @hritikakhattar
I understand you want to hide or delete the size chart for jewelry items. You can achieve this by modifying the conditional logic in your Liquid template to ensure that the size chart only appears for clothing items. Here’s how you can do it
Add Conditional Logic Based on Product Type or Tag : Modify the Liquid code to display the size chart only for clothing items. Here’s an example of how you can do this using a product tag:

{% if product.product_type == 'Clothing' %}
  <!-- Size chart metafield -->
  {% unless product.metafields.custom.size_chart == blank %}
    <div class="size-chart">
      {{ product.metafields.custom.size_chart }}
    </div>
  {% endunless %}
{% endif %}

Hey @hritikakhattar ,

You can follow this documentation from Shopify about creating new templates: https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates#create-a-new-template
This documentation for applying a new template to the products: https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates#bulk-template-changes

Also you can take a look at this video for the practical implementation: https://www.youtube.com/watch?v=rppKgzoAkQc

I hope this helps!

Regards,

Abhishek from Swym

Could you please let me know where to paste the code?
That would be great

Please find the store link below

https://boutu.in/

Hey @hritikakhattar

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag

{%- assign product_collections = product.collections | map: 'handle' -%}
{%- if product_collections contains 'jewellery_all' -%}

{%- else -%}

{%- endif -%}

RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

Thank you so much
It workedddd

1 Like

Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.