Personalized checkout and custom promotions with Shopify Scripts
I'm trying to follow this procedure:
https://docs.minionmade.com/shopify/change-description-based-on-variant-selected-in-shopify
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.
<script>
var selectCallback = function(variant, selector) {
$('.description').css('display', 'none');
$('#' + variant.id).css('display', 'block');
}
</script>
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?
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.
ok, i've included metafields instead for my variants... but now how do I trigger to display the metafield variant on selection?
This is my issue as well! someone help
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025