How to hide sold-out products in Shopify?

How to hide sold-out products in Shopify?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by augustine , 10 months ago

@tess.kassulke 

To hide sold-out products in Shopify, you can follow these steps:

  1. Log in to your Shopify admin panel.
  2. Click on "Online Store" in the left sidebar.
  3. Select "Themes" from the dropdown menu.
  4. Locate the current theme you're using and click "Actions."
  5. From the dropdown menu, select "Edit code."
  6. In the theme editor, locate the "Sections" folder and click to expand it.
  7. Locate the "product-template.liquid" file and click to open it.
  8. Within the "product-template.liquid" file, search for the following code: {% if product.available %}
  9. Replace the above code with the following snippet: {% if product.available and product.inventory_quantity > 0 %}
  10. Save the changes by clicking on the "Save" button at the top right corner.
  11. Repeat steps 6 to 10 for any other related product templates if necessary.
  12. Preview your changes and make sure that the sold-out products are hidden.


By modifying the code in the theme editor as described above, the products that are sold out or have no inventory will be hidden from your Shopify store.