Hi there,
Is it possible to hide specific variants for a product?
For example, we sell smartphones on contracts and the variants I have setup are "storage - color - contract term". I have an:
- iPhone 32GB - Black - 3YR
- iPhone 32GB - Black - 2YR
- iPhone 32GB - Red - 3YR
- iPhone 32GB - Red - 2YR
I would like to hide the "iPhone 32GB - Red - 3YR" and leave the "iPhone 32GB - Red - 2YR". Is this possible through coding? I know I can hide the entire product when they're out of stock but I cant seem to find a way (or an app) that will let me hide variant specific.
Any suggestions?
Thanks!
For that you have to check in section->product-template.liquid file where you can find variants loop (Find "for value in option.values") and manage by this code.
https://jump1234.myshopify.com/collections/apple-iphone/products/iphone-8-plus?variant=2066486421099...
In this example, for the 64GB-Gray I want to hide the variant price called "Plus Pricing Two-Year Voice & Data (+$5/month)". So essentially if the customer selects the 64GB-Gray they'll only see the "Two Year Voice & Data" however, if they select the 128GB they'll see both the "Plus Pricing Two-Year Voice & Data (+$5/month)" and "Two Year Voice & Data" variant.
Thanks!
This is not easly done by simple code because you just want to hide some text from variants and for only in some condition, and you have many product in store so may be you need developer for that if you have not exact knowledge with Js and Liquid. You want to do this for only given product?
Let me know if you need help for that.
Yes but is there any exact condition in which we can remove text from variants like you just want to remove Plus Pricing and (+$5/month) from all 64GB variants? its important to set condition because we need to just remove some text from variants.
Hi Jasoliya,
As far as conditions go, I'm not sure if this is possible but if we can have it so that:
"If product variant" is "0.01" variant will be hidden
Something along those lines. Since none of our products will cost "$0.01", I was thinking if thats a possible condition so that when I input $0.01 in the price field of that variant it will be hidden from the front end (product page)?
Yes in terms of removing 'Plus Pricing' and (+$5/month) from that specific product - as long as it doesn't hide "all" Plus Pricing and (+$5/month) from my other products.
Thanks again
"If product variant" is "0.01" variant will be hidden,
This is not possible because we have price of all combination like "64GB / Gray / Plus Pricing Two-Year Voice Data (+$5/month)", so we can not check hide base on this and also you have to manage in select-callback function because when user change option we need to still check this condition. So may be for that you need developer let me know if you need help.
User | Count |
---|---|
796 | |
132 | |
93 | |
64 | |
60 |