Change product description by variant in venture

New Member
3 0 0

I have a couple of products that have a large amount of variants, which each variant requiring a small write up. (In my situation it will be a better solution to keep these variants together under the same base product as apposed to creating a new separate products).

 

From my under standing I have get my products variant ID, which I have done by adding .xml to the end of my products admin link. From that point my product description looks like this: 

 

<p class="description" id="########">Description for var 1</p>
<p class="description" id="########" style="display: none;">Description for var 2</p>
.... etc

Up to this point I was following this tutorial: https://community.shopify.com/c/Shopify-Design/Demo-change-description-in-product-with-different-var...

 

Having this done in the description you need to edit the product.liquid (or wherever your variant change is) and add this:

// selectCallback is the callback name in Timber
var selectCallback = function(variant, selector) {

   // Simply toggle on/off the panel according to the variant selected
$
('.description').css('display', 'none');
$
('#' + variant.id).css('display', 'block'); // rest of the Timber code
}

I am using the Venture Theme, and for the life of me I cannot figure out:

a) where to put the code above in venture?

           - does venture use the selectCallback function?

b) if this method is applicable to use in 2020 with Shopify?

 

Any information would be greatly appreciated, I've yet to find a straight forward answer to this question.

Thanks.

0 Likes