I want to hide the product inventory, but just for one collection.
Topic summary
A user wants to hide product inventory display for items within a specific collection only, not store-wide.
Proposed Solution:
A community member provided a code snippet using Liquid templating to conditionally hide inventory:
- Assign the target collection to a variable
- Use
{% unless product.collections contains collection_to_exclude %}to wrap the inventory display code - This prevents inventory from showing for products in the specified collection
Implementation Notes:
- The exact code location varies by theme
- The provided code example needs adjustment based on the specific theme structure
- One responder offered paid assistance to implement the change safely without breaking the theme
Status: The discussion remains open with a technical solution provided but not yet confirmed as implemented.
Hey @hapq95
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Hi @hapq95
Are you looking to hide the product inventory for products inside a certain collection?
If so, your theme’s code needs to be changed. First, you’ll need to look for the code for the product inventory. Then, add a conditional like the one below in order to hide the product inventory of a product belonging to a certain collection.
{% assign collection_to_exclude = collections['collection-name'] %}
{% unless product.collections contains collection_to_exclude %}
code for the product inventory
{% endunless %}
After saving, that should hide the product inventory for products that belong to a certain collection. Be sure to change the code example I gave above as it will vary from theme to theme.
Hope this helps and if you have any questions, feel free to ask here or through my contact email below!
![]()
If you’re uncomfortable with touching your theme’s code because of instances where the theme might break, I’d be happy to do it for a fee. I’ll make sure that the change we’ll add doesn’t break your theme and that the product inventory will hide according to your requirements. Let me know if you’re interested via the comments or via my contact email below! ![]()
