d
Topic
Rebeca Member
Posts:
1
7 months ago

Venture Theme - How do I hide variants on the product page for an option with only one variant?

I'm using the theme Venture. Does anyone know how I hide variants on the product page for an option with only one variant?

i
Replies
Posts:
4
4 months ago

im curious to find this out to im trying to remove color codes for shirts with multiple sizes but only one color

tim Member trezoro.co
Posts:
1666
Last edited 4 months ago

Hi guys,  

this can be done with some javascript, like this:

/* hide selectors with only one choice */
$( $('.selector-wrapper').filter( function() { 
     return $(this).find('option').size() < 2;
  }).hide() )

May try putting it at the bottom of the theme.js.liquid  Asset

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com! My post solved your problem? This is my Paypal too :)