Cart line item partially working (missing product image, price)

Highlighted
Shopify Partner
22 1 3

Hi,

I hope you are doing great!

I am facing an issue with the cart line item since yesterday.

While adding a product to the cart page with product properties using Ajax API call "/cart/add.js"

It was working fine since yesterday and Now it is not showing price and product image in the line item of cart page cart.

When I redirect customer to cart page after clicking add to cart button and get response in success callback of the jQuery Ajax. I am getting lineitem with missing image ,zero price and after refresh this cart page again it will show the cart item properly.

Below is the code of ajax cart api if you want to test this scenario.

 

var productProperties = {};
productProperties['first'] ='first';
productProperties['Second'] = 'Second';
productProperties['test'] = 'test';
var productData = { quantity: 1, 
                                 id: , 12345678 // add your shop variant id here.
                                 properties: productProperties
                                };
 var url = "/cart/add.js";
  $.ajax({
       type: "POST",
       url: url,
       data: productData,
       dataType: "json",
       success: function (response) {
              if(response.status==200){
                   window.location.href = '/cart';
              }
        }, error: function (response) {
                    console.log('error');
             }
});

 



Sometimes it works fine and sometimes it not working.

 

 

 

0 Likes
Highlighted
Shopify Partner
22 1 3

@Caroline_Schnap

I need your help on this issue. It will be great if you find some time and reply on this thread.

Looking forward to hearing from you soon.

Thanks in advance.

0 Likes
Highlighted
Shopify Partner
22 1 3

Actually, this is not the Cart Ajax API issue. Sometimes cart is taking 15 - 20 seconds time to load the cart line items.

It will be great if Shopify support can investigate this issue. 

Your contribution is required on this issue. @SBD_ , @vix , @Busfox@Shopify  

0 Likes