Product variants is not working

New Member
1 0 0

We're using variants for some products on our store, but they suddenly stopped working for all our products.

Here's an example product.

When selected, the Price stay unchanged no matter which one you select and don't show up at all in the cart too.

What might be causing this?

 

0 Likes
Shopify Staff
Shopify Staff
390 17 27

Hello, Mellaly!

 

Ted here from Shopify, thanks for reaching out to us.

 

I was trying to look at the example you provided, however, the link to the product is broken. Could you provide another example? As well, what the name of the theme you are using? Have you changed any code or added any new apps to your admin?

 

Thanks a mill,
Ted
Social Care | Support@shopify.com

Ted | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
Tourist
16 0 1

First: In your <head> there is a line which is wrong:

  <script src="jquery-3.1.1.min.js"></script>

It is not a problem, because jQuery is loaded afterward, but anyway.

Second: There is a problem with a selectCallback function in the product. liquid  -- it throws out error "Uncaught SyntaxError: missing ) after argument list" in this line:

$(".product-price").html(Shopify.formatMoney(variant.price, "<span class="money">${{amount}}</span>"));

I believe, the problem here is in nested quotes. However, in your source, it most probably looks like

$(".product-price").html(Shopify.formatMoney(variant.price, "{{ shop.money_with_currency_format }}"));

To fix it, I'd recommend replacing the outer quotes with ticks, like this:

$(".product-price").html(Shopify.formatMoney(variant.price, '{{ shop.money_with_currency_format }}'));

There is another similar line, about two rows down, which should be modified as well. 

0 Likes