All things Shopify and commerce
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
Solved! Go to the solution
This is an accepted solution.
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 </body> tag
{%- assign product_collections = product.collections | map: 'handle' -%}
{%- if product_collections contains 'jewellery_all' -%}
<style>
modal-opener.product-popup-modal__opener.quick-add-hidden {
display: none;
}
</style>
{%- else -%}
<style>
modal-opener.product-popup-modal__opener.quick-add-hidden {
display: inline-block;
}
</style>
{%- endif -%}
RESULT:
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
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
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hey @hritikakhattar
Share your Store URL and Password if enabled.
Best Regards,
Moeed
This is an accepted solution.
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 </body> tag
{%- assign product_collections = product.collections | map: 'handle' -%}
{%- if product_collections contains 'jewellery_all' -%}
<style>
modal-opener.product-popup-modal__opener.quick-add-hidden {
display: none;
}
</style>
{%- else -%}
<style>
modal-opener.product-popup-modal__opener.quick-add-hidden {
display: inline-block;
}
</style>
{%- 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
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.
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 %}
Could you please let me know where to paste the code?
That would be great
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-templa...
This documentation for applying a new template to the products: https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates#bulk-template-chang...
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
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025