Hiding out of stock products (but not TOO hidden)

Hiding out of stock products (but not TOO hidden)

omegacanuck
Tourist
10 0 8

Looking to find a way to hide out of stock products so that they aren't found when just browsing the website (especially through Product Type) but that they're still viewable if someone has a direct link, like say their order history, or a Google result, or, you know an actual direct link.   Just want them hidden when people are browsing product types.

 

Any ideas?  Thanks.

Replies 2 (2)

PaulNewton
Shopify Partner
6756 610 1437

@omegacanuck  That requires advanced theme customizations to not render products for the property urls like ?types or ?vendors and in endpoints like search.

 

At minimum for smart collections add a condition to ignore out of stock products, sometimes by using tags in tandem with shopify-flow or other automations.

For manual collections again use auomations using shopify-flow or usemehanic to remove sold out products from the collections.

Examples https://tasks.mechanic.dev/?q=out%20of%20stock 

 

There's also content-gating apps like locksmith (also made by lightward, developers of mechanic)

https://www.locksmith.guide/faqs/can-locksmith-hide-content-from-my-in-store-search 

 

If you need this advanced customization and automations then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

 

 

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


BSSCommerce-B2B
Shopify Partner
1319 346 407

Hi @omegacanuck,

I hope you are doing well.

The product is listed in some kind of section; each kind has a different way to show the product card. If you are using Dawn, here are examples how to hide out-of-stock products

1. Featured Products

Open file "product-collection.liquid", find {%- for product in section.settings.collection.products and add these codes right after forloop

{% unless product.available %}{% continue %}{% endunless %}

BSSCommerceB2B_0-1723949853691.png

 

2. Collection

Open file "main-collection-product-grid.liquid", find {%- for product in collection.products -%} and add these codes right after forloop

 

{% unless product.available %}{% continue %}{% endunless %}

 

 

BSSCommerceB2B_3-1723950192279.png

 

3. Related products

Open file "related-products.liquid", find {% for recommendation in recommendations.products %} and add these codes right after forloop

 

{% unless recommendation.available %}{% continue %}{% endunless %}

 

 

BSSCommerceB2B_2-1723950094540.png

 

4. Search suggestion

Open file "predictive-search.liquid", find {%- for product in predictive_search.resources.products -%} and add these codes right after forloop

 

{% unless product.available %}{% continue %}{% endunless %}

 

 

BSSCommerceB2B_1-1723949929517.png

 

5. Search page

Open file "main-search.liquid", find {%- when 'product' -%} and add these codes right after when tag

 

{% unless item.available %}{% continue %}{% endunless %}

 

BSSCommerceB2B_4-1723950311000.png

 

I hope this is useful to you.

If our suggestions are useful, please let us know by giving it a like, marking it as a solution.


BSS: B2B Wholesale Solution |BSS: B2B Portal, Quote, Net 30 | B: B2B Lock Password Protect


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency