I would like to hide some sections of my product page, but just for certain collections.
Hi, @hapq95
Thanks for reaching out to the community. We are MooseDesk, a comprehensive Live Chat, FAQ & Helpdesk App designed to elevate your customer support experience.
To hide certain sections of the product page for specific collections on Shopify, you can achieve this by adding a conditional Liquid code to your product template. Hereâs a step-by-step guide:
Step 1: Identify the Section You Want to Hide
First, make sure you know which sections of the product page you want to hide. These are usually located in your product.liquid template or in a product section file (such as product-template.liquid).
Step 2: Add Conditional Logic Based on the Collection
Youâll need to modify the template to include conditional logic that checks if the product belongs to a certain collection. This can be done using Liquidâs collection object.
Example Code
Hereâs an example of how you can hide a section based on the collection a product belongs to.
- Open your Shopify admin and go to Online Store > Themes.
- Click Actions > Edit code on your current theme.
- Find the product template file, typically under Sections or Templates, for example, product.liquid or product-template.liquid.
- Locate the section you want to hide.
- Surround it with a conditional statement.
{% if current_tags contains âSpecial Collectionâ %} {% else %}
In this example:
- Replace âSpecial Collectionâ with the name or handle of the collection you want to target.
- Alternatively, you can use the collection handle, like so:
{% if collection.handle == âyour-collection-handleâ %}
{% else %} {% endif %}Step 3: Test Your Changes
After making the changes, preview your product pages to ensure the section is hidden or displayed correctly based on the collection.
This method should allow you to control which sections appear on product pages based on the collection they belong to.
I hope this answer addresses your question effectively. If you found it helpful, weâd appreciate a âLIKEâ for MooseDesk. If your issue is resolved, please mark this as 'SOLUTIONâ.
In the meantime, our MooseDesk Team is always here to help with customer support solutions. Weâre passionate about improving your customer experiences through our Live Chat, FAQ, and Helpdesk App.
With MooseDesk, you can engage with customers through omnichannel support, manage inquiries with a robust ticket system, and provide quick responses.
- Or you can let customers resolve questions faster with in-built FAQ, Order tracking module, and more.
Once again, keep up the fantastic work, and I wish you the best of luck in the future!

