Print on demand store here.
Our Products are created through our supplier’s app that makes the products for us.
Some products have multiple variants, some don’t.
In order to get a cleaner look, for the products that have only one variant, we don’t want to have the variant picker.
We can’t just delete the variant so it doesn’t show on product page, because when we do that the supplier receives an order of a product their system doesn’t recognize.
We want to hide the variant picker for those single variant products while we still have the variant picker for products with multiple variants.
Any help is appreciated
Hello @SiteBuilder
Sure for variant picker. find the code in product-form.liquid or product-template.liquid file and add below condition:
{% if product.variant.size > 1 %}
VARIANT PICKER CODE
{% endif %}
Thanks
1 Like
Thanks for your reply but find what code? What am I looking for?
And then what do I need to paste there? “VARIANT PICKER CODE” isn’t a condition so I’m not sure what you mean
Find the variant picker code in your theme and add the condition above the variant picker opening and closing div.
{% if product.variant.size > 1 %} {% endif %}
You only have to add the given if statement.
Thanks
I am using a Shopify 2.0 theme (Dawn 12.0.0)
I do not have a product-form.liquid or product-template.liquid file in my code files
I do have a main-product.liquid, eben a product-variant-picker.liquid and many others.
Which file can it be?
Also, when I am in the file, what do I have to look for? is it variant-selects?
Can you show an example?
This is awesome, thanks a lot, very helpful.
I just have a problem now, when a product has only one color but several sizes (like a piece of clothing), it hides the size selector because the color variant is 1.
We would like to hide the color picker if the color option has only one variant but we would still need to show the size picker so the customer can choose them.
What tweak should we do?
PS: right now, when a product has only one variant it hides the variant picker which is exactly what we want. We just need to make it a little more sophisticated for products with several options
If possible to provide store access so I will make the code changes as per need then please let me know.
store is bylderz.fr
you can let me know here so it helps others, I’ll make changes myself if that’s ok
Hi mate, thanks for the code. How would I apply this if I have both Colour & Size variant options? i.e. I’d like to hide the colour variants only if only 1 colour, or hide the size variants only if only 1 size.
Hello
Thanks for connecting with Shopify Community.
This will need a code tweak. So I worry if you are not technical the site
can break if you edit the code by your own as the code tweak will be based
on the theme used. So if you are interested feel free to send your query on
mail mentioned in below signature.