Shopify themes, liquid, logos, and UX
Please help with this. Been looking since forever.
Hi,
To hide unavailable product from search, you have to edit Snippets > card-product.liquid file.
Before editing the file, please make a backup file or backup your theme.
Please follow the steps below.
1. Go to Edit code > Snippets > card-product.liquid file.
2. Add the code below before <div class="card-wrapper underline-links-hover"> (line 33)
{% unless card_product.available == false and template.name == 'search' %}
The above code is only for search results.
If you want to hide unavailable product completely from collection pages and sections, you can use the code below.
{% unless card_product.available == false %}
It must be the same as below.
3. Go to line 220 and add the code below.
{% endunless %}
It must be added before {%- else -%} tag as below.
4. Save the change and test your search.
In case you can't edit the code, please send me a private message.
Hope it helps.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024