Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I'm using the Prestige theme for a site.
95% of the products only have one variant. But the last 5% come in different sizes. Naturally I only want to show the variant picker on the product page for those 5%.
If I turn it on, then all products show the variant picker - the 95% just show the one color the product comes in and the last % show color and size.
I only want it to show sizes on the last 5%, but nothing on the rest. Using different templates for the products is not an option.
Can anybody help?
Thanks!
Mads
Hi @mkagency
Try the following code, not tested though. In file snippets/product-info.liquid
{%- when 'variant_picker' -%}
{%- if product != blank -%}
{% unless product.has_only_default_variant %}
{%- render 'variant-picker'...-%}
{% endunless %}
{%- endif -%}
Hi Laza,
Thanks for the suggestion 🙂
Can you help me with where to place the code in the file? I tried to place it myself, but it didn't work.
Thanks!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024