How to show variant picker only for certain products in Prestige Theme?

How to show variant picker only for certain products in Prestige Theme?

mkagency
Shopify Partner
16 0 3

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

Replies 2 (2)

Laza_Binaery
Shopify Partner
133 30 49

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 -%}

 

 

Kind regards
Laza
www.binaery.com
mkagency
Shopify Partner
16 0 3

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!