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.
@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.
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 %}
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 %}
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 %}
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 %}
5. Search page
Open file “main-search.liquid”, find {%- when ‘product’ -%} and add these codes right after when tag
{% unless item.available %}{% continue %}{% endunless %}
I hope this is useful to you.