Home › Forums › Themes Support › Claue-Shopify › SKU does not change when different variants are selected
Tagged: sku variant
- This topic has 1 reply, 1 voice, and was last updated 5 years, 10 months ago by rjhodges.
-
AuthorPosts
-
-
January 27, 2019 at 7:03 am #28537
Hey guys, I am now realizing months later that the SKU does not change when different variants are selected (like the product price changes) unless you physically reload the page in the browser. I just now did a fresh install of the last claue update that you provided months ago and I also looked at your live online demo and the problem is identifiable there as well. Please see attachments showing that the variant URL changes as I select different Letters ‘A’ ‘B’ and ‘F’ (and the price changes as appropriate) yet the SKU remains static.
Further, I looked at the ‘.js and min.js’ files and ‘sku’ or ‘variant-sku’ etc. does not appear anywhere in either file which naturally it would have to be written somewhere into the js to function properly, right?
Can you please correct this or tell me what I need to add to the .js files so that the SKU will indeed change as different variants are selected? Thanks!
Ryan
Attachments:
You must be logged in to view attached files. -
January 31, 2019 at 12:47 pm #28611
if anyone else wants to make the SKU variant switcher actually function properly, simply search for and replace the “claue.MultipleVariants…” section in your claue.min.js.liquid file with:
claue.MultipleVariants=function(i){var a=i.money_format,r=i.variant,t=$(“.product-single__content .product__price”),e=””,p=$(“.product-single__sku”),c=””;r&&(r.sku&&(c+='<span class=”product-single__sku”>’+r.sku+”</span>”),p.html(c),r.featured_image&&setTimeout(function(){$(‘.product-single__thumbnail-variant[data-variant-id=”‘+r.id+'”]’).trigger(“click”)},0),r.compare_at_price>r.price?(e+='<span class=”product__price–sale”>’+Shopify.formatMoney(r.price,a)+”</span>”,e+='<s class=”product__price–original” itemprop=”price” content=”‘+Shopify.formatMoney(r.price,a)+'”>’+Shopify.formatMoney(r.compare_at_price,a)+”</s>”):e+='<span class=”product__price–original”>’+Shopify.formatMoney(r.price,a)+”</span>”,t.html(e))};
RJ
-
-
AuthorPosts
You must be logged in to reply to this topic.