Hiding variants that are out of stock?

Highlighted
Shopify Partner
74 0 0

Hello there,

I just recently started using variants for the products on my store.

These are limited edition prints for which I sometimes have multiple copies of the edition.

I wondered if there's a clever way to get Shopify to 'hide' variants that are no longer in stock?

If you look at this print:

http://www.stjudesprints.co.uk/collections/emily-sutton/products/silver-swan

I had 5 copies of the edition.

If the customer tries to purchase the first 2, they get a 'sold out' message.

They'd have to keep trying until they successfully add the 3rd one listed to their basket.

I'm just a bit concerned that this isn't very intuitive from the customer's point of view.

I guess I can manually delete the sold out variants - but I just wondered if there would be a way to automate the process?

Thanks!

Simon

0 Likes
Shopify Staff
Shopify Staff
5826 0 276

Hi Simon,

Sure you can.

In product.liquid, you'll add a condition where the select element is generated.

You'll use this condition:

{% if variant.available %}

to output (or not) the option element.

 

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
Shopify Staff
Shopify Staff
5826 0 276

Hi Simon,

Check your email :)

Caroline

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes