Feature Request - Publish/Unpublish Variants

I can’t see anywhere that I can request a feature update to be added to the Shopify Roadmap.

So I am posting it here in the hope that it will be picked up and passed on.

It would be AWESOME to be able to unpublish variants of a product. I know they can be made out of stock, but for instance, we launch new variants of an existing product, and it would be so much easier to be able to add them alongside existing variants ahead of time, but hide them from the front end.

To hide a specific product on the front end while keeping it live in the admin settings, you can follow these steps:

Add a tag to the product you want to hide. Let’s say you tag it with ‘your tag name’.

Modify your product display code as follows:

{% unless product.tags contains ‘your tag name’ %}

{% endunless %}

This code will ensure that the product is only displayed on the front end if it does not have the ‘your tag name’ tag. If the product has this tag, it will not be shown to users on the website.

Hi,

Hiding products is not a problem. It’s hiding specific variants of a product that I’d like to do. Is that possible with tags? I think only products can have tags not variants. Is that correct?

Yes, Variants do not have tags but still you can hide variants on base of their title

{% for variant in product.variants %}
{% unless variant.title == ‘Title of Variant to Hide’ or variant.option1 == ‘Option to Hide’ %}

{% endunless %}
{% endfor %}

That’s a great start, thank you. We can do that and add a word that is nowhere else. As most of our products variants are colours we use on other products, we couldn’t do it just on the title as is.

Thanks so much for your help! I’ll implement it and see how we go :slightly_smiling_face:

I appreciate your gratitude.
Feel free to give the solution a try. If it works, please approve it. If it doesn’t, just let me know, and I’ll investigate the code more thoroughly.

Where would be the best place to put the code? I never designed the website so I am following someone elses code :expressionless_face:

I had a quick look at the product-form.liquid code but to be honest, I’m still learning all this!

To have me review your code, I require collaborator access to your store.

Now shopify has enabled this feature to make the product specific variant draft or live.

Shopify recently has released feature that allows publishing / unpublishing of product variants ( Product Variant Publishing - Shopify Changelog ).

You can unpublish a product variant from online store sales channel, if you don’t want customers to see it on the online store.

In the variant list in the product detail page (Shopify Admin), click on the publishing icon, and uncheck the “Online store” channel :

After saving, the variant will not be visible / available on the online store, visitors will not be able to see it / purchase it.

We’ve had this issue for a while too.
The hard part isn’t even the storefront side, it’s that once the variant exists in admin, people start treating it like it’s already live. Someone links it early, merchandising forgets what’s hidden where, support gets confused, etc.
Being able to keep variants in a true draft state would remove a surprising amount of launch-day stress.