What's your biggest current challenge? Have your say in Community Polls along the right column.

Exclude Specific Product from Collection filters

Exclude Specific Product from Collection filters

sajidWEP
Tourist
6 0 1

Hi

Can anyone explain me how I can exclude specific products from the filter results and search results, on collection page? using tags or any other conditional statement?

Thanks

 

Replies 10 (10)

sahilsharma9515
Shopify Partner
1264 163 243

Hi  @sajidWEP 

 

There are 2 ways through which you can do this:

 

  1. You can just set the product as a Draft, which only allows your Staff to view it and never appears on the search bar, but I think you want hide a product from your storefront but still allow users to access it via a direct link. So for that case you can go to next point

  2. Please follow this guide.
    Login to the store admin then Settings > Custom Data and click Products
    Click Add Definition to add a new product metafield.
    Name: Metafield name (e.g. Hide Product)
    Namespace and key: seo.hidden
    Description: up to you
    Type: Number [Integer]

sahilsharma9515_0-1696923025171.png

 

At this point, if you Edit any product you'll find a new metafield at the bottom of the page: just fill it with 1

 

sahilsharma9515_1-1696923089837.png

 

Please Note: As far as I know, using conditions in rendering may lead to distorted search result product grid and is not ideal. That's why I didn't provide you the solution through this method.

 

Hopefully it will help you. If yes then Please hit Like and Mark it as solution!

 

Best Regards

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


sajidWEP
Tourist
6 0 1

I have a sort by option on my collection page but when I refine the products by clicking on the sort by option it show me that product too.. I have followed your solution but still no progress.

Thanks

sahilsharma9515
Shopify Partner
1264 163 243

Can you please provide me the url of your store?

 

If you just don't want to show the product in a collection you can remove it from that collection(if you have created a manual collection)

 

If you have created a automatic collection then you can take help of tags and create a collection that will only contains a specific tag.

For example: first you need to add tag on the products you want to show in a specific collection like "xyz".

Then create a collection with a condition that if the product tag will be "xyz " then the product will be added in that collection in this way the product you don't want to show, you will not add this tag on that product, and those product will not appear in that collection.

 

Hopefully it will help you. If yes then Please hit Like and Mark it as solution!

 

Best Regards

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


sajidWEP
Tourist
6 0 1

Hi @sahilsharma9515 

Actually you did't understand my question, I have a sort by option like filters in the sidebar of the collection pages when we choose available products it shows the available products, in that products there are the products included which i want to hide from the results of the search as well as from the collection filters.

 

Thanks for your quick response.

sahilsharma9515
Shopify Partner
1264 163 243

Hi @sajidWEP 

 

I got your point that's why I have specified that if you don't want to show some product in the some collection then just remove that product from that specific collection and for removing that product from search as well, I have already specified the steps with the help of metafield that how you can solve that part.

 

Hopefully it will help you. If yes then Please hit Like and Mark it as solution!

 

Best Regards

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


sajidWEP
Tourist
6 0 1

sorry for confusion i want to hide the products not for specific collection over all entire store when a user land on the store the hidden products will not show in the filters only show in that collection.

 

Thanks

sahilsharma9515
Shopify Partner
1264 163 243

Could you please provide your Store URL and, if applicable, the Password too? Your cooperation is greatly appreciated!

 

Best Regards,

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


sajidWEP
Tourist
6 0 1

Hi,

 

In this screenshot when i click on browse by category all the products will show from the entire collections but i don't want to show the product which have 1 value in the meta fields like you provide me the above solution.

 

thanks

sahilsharma9515
Shopify Partner
1264 163 243

Sorry but there is no screenshot attached, also it will be easy for me to understand your part if you can provide me the Store URL.

 

Best Regards,

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


sajidWEP
Tourist
6 0 1

2023-10-10 15_12_23-.png