Re: Hide out-of-stock products using an liquid code change on theme files

Solved

Hide out-of-stock products using an liquid code change on theme files

ErSanjay
Shopify Partner
321 20 47

Hi all.

 

I don't want so the  Sold out product on the home page collection and product details page. 

Hide out-of-stock products using an liquid code change on theme files

 

Thanks for help

Business Owner & Shopify Plus, Shopify app , Shopify Consultant - Full Stack Sofware Engineer
Warm regards,
Er Sanjay

If you find yourself in need of assistance with your store, don't hesitate to reach out! Feel free to send me a direct message, and I'll do my best to help you out.
Accepted Solution (1)
ErSanjay
Shopify Partner
321 20 47

This is an accepted solution.

@Boost_Commerce 

I know your team was an expert. have many great engineering solutions I fixed using the liquid 

 {%- when 'product' -%}
                      {%- capture product_settings -%}{%- if section.settings.product_show_vendor -%}vendor,{%- endif -%}title,price{%- endcapture -%}
                   {% if product.available == true %}   
                    {% render 'card-product',
                          card_product: item,
                          media_aspect_ratio: section.settings.image_ratio,
                          show_secondary_image: section.settings.show_secondary_image,
                          show_vendor: section.settings.show_vendor,
                          show_rating: section.settings.show_rating,
                          lazy_load: lazy_load
                        %}
                    {%- endif -%}


reference  https://shopify.dev/api/liquid/objects/product?shpxid=5dd36f15-E244-4670-4217-7125EA382529#product-a...

Thanks @Shopify   for batter documentation  

Business Owner & Shopify Plus, Shopify app , Shopify Consultant - Full Stack Sofware Engineer
Warm regards,
Er Sanjay

If you find yourself in need of assistance with your store, don't hesitate to reach out! Feel free to send me a direct message, and I'll do my best to help you out.

View solution in original post

Replies 4 (4)

Boost_Commerce
Shopify Partner
31 0 23

Hi @ErSanjay 

You can use automated collections to hide out-of-stock products from your customers. You can do this manually on the Collections page of your Shopify admin, or use an inventory management app to do it for you.

You might also want to hide products in your store's default Catalog collection.

 

Highly recommend reading this document

Product Filter & Search by Boost Commerce
#1 Product Filters & Search for brands of all sizes
---------------------------------------------------------------------
Insights of eCommerce Filter & Search for 2022 - Best Practices from Top Shopify Stores
ErSanjay
Shopify Partner
321 20 47

@Boost_commner i want to hide with code

Business Owner & Shopify Plus, Shopify app , Shopify Consultant - Full Stack Sofware Engineer
Warm regards,
Er Sanjay

If you find yourself in need of assistance with your store, don't hesitate to reach out! Feel free to send me a direct message, and I'll do my best to help you out.
Boost_Commerce
Shopify Partner
31 0 23

Hi @ErSanjay, in this case, we recommend you to contact a Shopify Expert or Theme Expert as this will depend on which theme you are using. 

Product Filter & Search by Boost Commerce
#1 Product Filters & Search for brands of all sizes
---------------------------------------------------------------------
Insights of eCommerce Filter & Search for 2022 - Best Practices from Top Shopify Stores
ErSanjay
Shopify Partner
321 20 47

This is an accepted solution.

@Boost_Commerce 

I know your team was an expert. have many great engineering solutions I fixed using the liquid 

 {%- when 'product' -%}
                      {%- capture product_settings -%}{%- if section.settings.product_show_vendor -%}vendor,{%- endif -%}title,price{%- endcapture -%}
                   {% if product.available == true %}   
                    {% render 'card-product',
                          card_product: item,
                          media_aspect_ratio: section.settings.image_ratio,
                          show_secondary_image: section.settings.show_secondary_image,
                          show_vendor: section.settings.show_vendor,
                          show_rating: section.settings.show_rating,
                          lazy_load: lazy_load
                        %}
                    {%- endif -%}


reference  https://shopify.dev/api/liquid/objects/product?shpxid=5dd36f15-E244-4670-4217-7125EA382529#product-a...

Thanks @Shopify   for batter documentation  

Business Owner & Shopify Plus, Shopify app , Shopify Consultant - Full Stack Sofware Engineer
Warm regards,
Er Sanjay

If you find yourself in need of assistance with your store, don't hesitate to reach out! Feel free to send me a direct message, and I'll do my best to help you out.