How Can I Hide Products in My Christmas Collection?

I wish to take my Christmas items off from sale until next year but keep them as Drafts so they are ready to go.

Many products are in more than 1 Collection and these items I DO NOT want to remove from sale. eg if a product is in my Homewares Collection and Christmas Collection I want it to remain available, but if it is only in the Christmas one I want it unavailable.

How can I do this?

I have many thousands of items so one by one isn’t going to be practical

Thanks

You mean a product if in one collection will not only show?

Yes, if it is only in the Christmas Collection I want it not available

Hello @Sam247

Can you please share screenshot of the collection we need to check what condition are add in to this collection.

See image:

Step1:online-store → theme → edit code
Step2:template → collection.liquid(collection.json)

Find recycling products add a judgment

{% for product in collection.products %}
{% for coll in product.collections %}
{% unless product.collections.size == 1 and coll.handle == "Christmas" %}
//your product item.....
{% endunless %}
{% endfor %}
{% endfor %}

You can try this judgment, he means the product is only one set there are and the handle is you specify the collection.

This is what I have in that file now, doesnt seem to work, what would be wrong?

{% comment %}
  The contents of the collection.liquid template can be found in /sections/collection-template.liquid
{% endcomment %}

{% section 'collection-template' %}

{% for product in collection.products %}
{% for collectionHandle in product.collections %}
{% unless product.collections.size == 1 and collectionHandle == "CHRISTMAS" %}
//your product item.....
{% endunless %}
{% endfor %}
{% endfor %}

To find the collection-template section, and find a cycle in this your product item, use the code I gave you to replace.Can you give me your shop url?

How / where might I need to insert it in this section? (I think this looks like the right section)

Thanks for helping

{% for product in collection.products %}
          {% comment %}
          {% if has_sidebar %}
            {% assign grid_item_width = 'large--one-quarter medium--one-third small--one-half' %}
          {% else %}
            {% assign grid_item_width = 'large--one-fifth medium--one-third small--one-half' %}
          {% endif %}
          {% endcomment %}
          {% include 'product-grid-item' with grid_item_width %}

        {% else %}

          
            

{{ 'collections.general.no_matches' | t }}

          

        {% endfor %}
{% for product in collection.products %}
          {% comment %}
          {% if has_sidebar %}
            {% assign grid_item_width = 'large--one-quarter medium--one-third small--one-half' %}
          {% else %}
            {% assign grid_item_width = 'large--one-fifth medium--one-third small--one-half' %}
          {% endif %}
          {% endcomment %}
{% unless product.collections.size == 1 and collectionHandle == "CHRISTMAS" %}
{% include 'product-grid-item' with grid_item_width %}
{% endunless %}
        {% else %}
   
            

{{ 'collections.general.no_matches' | t }}

          

        {% endfor %}

try this

The three lines of code you will I give you replace the product- gird- item is ok

Thanks, some other teams members have added Collections that are messing this up so I just need to clean up those and hopefully it will be all good, will post back once implemented

Now, this is a very great question! Hiding products is a very nice feature to offer your customer, instead of just showing the simple products which they can buy on the product page. I think there is no way to hide products, but you can use the template builder to order the products. Simply build a simple template with the products you want to display and then edit the template to order them how you want them to be displayed. I hope this is helpful, if you need any further assistance please let us know.