d
Topic
Rebeca Member
Posts:
1
January 12, 2017

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

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
10 months ago

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

Posts:
2065
Last edited 10 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 :)