New Shopify Certification now available: Liquid Storefronts for Theme Developers

Change the product description on variant selection with theme: pipeline

New Member
4 0 0

I'm trying to follow this procedure: 


But I understand that 

var selectCallback  is not the right way to go with the theme pipeline. 


I''m not sure how to fix it.


I've added the following lines at the end of product.liquid and it doesn't work.


var selectCallback = function(variant, selector) {

$('.description').css('display', 'none');
$('#' +'display', 'block');



For my product description, I was able to add the HTML with my proper product Variant ID


<p class="description" id="44036369187116">Description for variant 1</p>
<p class="description" id="44036369219884" style="display: none;">Description for variant 2</p>


Any idea how I can fix this?

Replies 2 (2)
Shopify Partner
2787 555 795

Hello @koakaya ,



First thing, this is an old way to add the variant description.  
To add description with variant you can use variant metafield.


Once you will add it then within the code you have to call it ( you can call all at same time within the loop ) and then with the help of JS show/hide a/to the selected variant. 



Need a Shopify developer? Email:

- Skype: navrocks1
- Try GEMPAGES a great page builder
-Advance Search Filter
New Member
4 0 0

ok, i've included metafields instead for my variants... but now how do I trigger to display the metafield variant on selection?