Hide collection section on the frontpage

hakonespen
New Member
3 0 0

We have a collection section on the frontpage that is used for discounted products that has a specific tag. Is it possible to hide this section when there is no products in the collection? When there is now discounted products there usually just gets regular priced products, that is not in the collection...

 

We use the Warehouse theme.

 

Thank you in advance.

 

 

0 Likes
LitExtension
Shopify Partner
688 71 124

Hi @hakonespen

Hope you are doing well. Please place this snippet where you want to hide the collection section: 

{% for tag in collections[collection_handle].all_tags %}

  {% if tag contains 'your_tag_name' %}

    {% assign has_discounted = true %}

  {% endif %}

{% endfor %}

{% if has_discounted %}

  Call data collection section.

{% endif %}

If you can not do that, you can add me as a staff, I'll check it for you.

LitExtension - Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
0 Likes
Ava
Shopify Staff
Shopify Staff
854 54 131

Hey, @hakonespen!

I'm Ava from Shopify Support, I have an option for you here to hide a collection that would not require coding. There is an option inside the Storefront Theme Editor for all themes, you can choose when you want a collection to show or when you want to hide it. You can click the eye icon, you can hide a collection from sight:

10-23-7gt91-8ilx5

 

 

This is the same page after clicking the eye icon:

10-26-vjsxd-mcf0f

So when you have no products on sale and want to hide the sales collection, you can do so easily within the Storefront editor. 

Let me know if this method is useful to you! 

Ava
Social Care | help.shopify.com

 

 

Ava | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes