Selected product variant does not apply to cart | Ella theme

Highlighted
New Member
3 0 0

Hello,

 

Some of you might recognise the issue in subject from existing topics. Before I decided to come to you, I did go through them but I did not find the solution because I have different error messages in the debugging console:

 

Uncaught TypeError: Cannot read property '0' of null
at updatePricing
at Shopify.OptionSelectors.selectCallback [as onVariantSelected] 
at Shopify.OptionSelectors.updateSelectors 
at HTMLSelectElement.element.onchange

at Object.trigger (jquery.min.js?6297:3)
at HTMLSelectElement.<anonymous> (jquery.min.js?6297:3)
at Function.each (jquery.min.js?6297:2)
at n.fn.init.each (jquery.min.js?6297:2)
at n.fn.init.trigger (jquery.min.js?6297:3)
at Shopify.OptionSelectors.selectVariant

 

I started troubleshooting on product.quickview.liquid file. What is causing the problem to me is that some well experienced community members blame the jquery.cart.min.js file instead. I would really appreciate if one of you could help me point to the right direction so I can use that knowledge in the future.

 

My website: ruhatunder.hu

Reference product: rose gold patent (it is a jacket for kids)

Issue: select size 134 (or any other than the first available size on stock (110)), then add it to cart. at the end in the cart you will always have a jacket in size 110 (Same issue with all products which are available with multiple variants.)

 

PM: Jason, I am really impressed about your responses, I think you have seen this issue before from other community member

 

Thank you in advance.

 

Bela

0 Likes
Highlighted
New Member
3 0 0

This is what I found so far. The below code seems to be causing the issue. In Visual code it detects issue with } brackets when I run it in node js, but it does not give you any syntax error if you debug the code in liquid. 

 

        if (unitPriceTextMatch) {
            var unitPriceText = unitPriceTextMatch[0];     
            var unitPrice = unitPriceText.replace(/[.|,]/g,'');
            var quantity = parseInt($('[data-qtt-id]').val());
            var totalPrice = unitPrice * quantity;

            var totalPriceText = Shopify.formatMoney(totalPrice, window.money_format);
            
            regex = /([0-9]+[.|,][0-9]+[.|,][0-9]+)/g;     
            if (!totalPriceText.match(regex)) {
                regex = /([0-9]+[.|,][0-9]+)/g;
            } 
            totalPriceText = totalPriceText.match(regex)[0];

            var regInput = new RegExp(unitPriceText, "g"); 
            var totalPriceHtml = $('.product .price').html().replace(regInput ,totalPriceText);

            $('.product .total-price span').html(totalPriceHtml); 
        }; 

 

0 Likes
Highlighted
Shopify Partner
380 28 48

@becfix 

Can you please share your store URL?

Thanks & Regards
Akshay Vaghasiya

Shopify Expert | Skype: akshayvaghasiya84
 - Like and Mark as an Accepted Solution if my reply helpful
 - Feel free to contact me on akshayvaghasiya84@gmail.com for any queries
 - Want to modify or custom changes on store hire me .
0 Likes
Highlighted
Shopify Expert
1381 111 206

please share a store url to better assist 

0 Likes
Highlighted
New Member
3 0 0

Hello,

 

It is ruhatunder.hu

 

thank you for your effort.

0 Likes
Highlighted
Shopify Partner
380 28 48

@becfix 

I have checked and found that the updatePricing() function is not working. Moreover, check why it is not working because it is a javascript error and I need your store access to check it. If you want me to fix the issue then please let me know I will send you a store admin collaborator access request.

If you want this issue fix faster then you can contact me through email or Skype.

Thanks & Regards
Akshay Vaghasiya

Shopify Expert | Skype: akshayvaghasiya84
 - Like and Mark as an Accepted Solution if my reply helpful
 - Feel free to contact me on akshayvaghasiya84@gmail.com for any queries
 - Want to modify or custom changes on store hire me .
0 Likes
Highlighted
Shopify Partner
380 28 48

@becfix 

Please check message.

Thanks & Regards
Akshay Vaghasiya

Shopify Expert | Skype: akshayvaghasiya84
 - Like and Mark as an Accepted Solution if my reply helpful
 - Feel free to contact me on akshayvaghasiya84@gmail.com for any queries
 - Want to modify or custom changes on store hire me .
0 Likes
Highlighted
New Member
9 0 0

Hi @Akshay_V,

 

I also have this exact issue with the Ella theme. My client sells slides (shoes). Her website is fluffmamas.co

We recently went live and started receiving an outpour of messages. It's come to our attention that customers are unable able to select their true shoe size. Whenever a customer selects their shoe size, no matter the size, the system overrides their selection and lists them as a size 6 versus the size that they've selected. Size 6 is the first and smallest shoe size, so I assume that it's making this selection by default.

Could you please help us to resolve this issue as soon as possible? I've reached out to the theme developers and they're out of the office until Monday.

The website just went live today and we're having so many customers inform us of this issue. 

0 Likes
Highlighted
Shopify Partner
380 28 48

@honchobranding 

Which theme version you are using?

Thanks & Regards
Akshay Vaghasiya

Shopify Expert | Skype: akshayvaghasiya84
 - Like and Mark as an Accepted Solution if my reply helpful
 - Feel free to contact me on akshayvaghasiya84@gmail.com for any queries
 - Want to modify or custom changes on store hire me .
0 Likes
Highlighted
Shopify Partner
380 28 48

@honchobranding 

Akshay_V_0-1597417708482.png

Akshay_V_0-1597417965907.png

 

As I can see, the theme code is not working properly. It looks like someone has modified theme code.

Thanks & Regards
Akshay Vaghasiya

Shopify Expert | Skype: akshayvaghasiya84
 - Like and Mark as an Accepted Solution if my reply helpful
 - Feel free to contact me on akshayvaghasiya84@gmail.com for any queries
 - Want to modify or custom changes on store hire me .
0 Likes