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 and Accept solution! or Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. 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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024