All things Shopify and commerce
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.
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
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.
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
By 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, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024