Website Building » Shopify » How Do I Hide Sold Out Variants on Shopify?

How Do I Hide Sold Out Variants on Shopify?

Last updated on October 1, 2022 @ 7:37 pm

If you’re using Shopify to sell products online, you may have noticed that some of your products are “sold out.” This can be frustrating for customers, who may see an item they want to purchase only to find out it’s no longer available. Fortunately, there is a way to hide sold out variants on Shopify.

To do this, you’ll need to access your theme code. Go to Online Store > Themes > Edit code. In the Assets folder, look for the product.liquid file and click on it.

Once you’re in the product.liquid file, look for the following line of code:

PRO TIP: If you are using Shopify to sell products online, you may want to hide sold out variants from your store. This can be done in the settings for each product. However, hiding sold out variants can make it difficult for customers to find the products they are looking for. If you do hide sold out variants, be sure to provide clear instructions on how customers can find the products they want.

{{ product.title }}
Replace that line of code with this one:

{% if product.available %}
{{ product.title }}
{% endif %}
What this does is check to see if the product is available before displaying the title. If it’s not available, the title won’t be displayed. That way, customers won’t see sold out products when they’re browsing your store.

You can also use this same method to hide other information about sold out products, such as the price or description. Just look for the lines of code that display that information and wrap them in an {% if %} statement like we did with the title above.

Hiding sold out variants on Shopify is a simple way to improve the customer experience on your store. By hiding sold out products, you can avoid frustrating customers and keep them coming back to your store again and again.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.