Magento | Use quantity increments and ajax add to cart on category page and product view

后端 未结 2 2087
渐次进展
渐次进展 2021-01-14 22:57

Here is the scenario:

I\'m using an ajax add to cart extention to add product to cart without refreshing page.

And I have modified the list.phtml file to hav

2条回答
  •  囚心锁ツ
    2021-01-14 23:14

    Was going to put this in as a comment, but need to format it for easier viewing

    I would recommend opening the page in Google Chrome and then using the developer tools to do a couple of things:

    1. Step through the jQuery code using the Script panel - you can then make sure that the code is setting the quantity correctly.

    2. Check that the request going via Ajax is correct. You can do this by looking at the Network panel, identifying the Ajax call and checking that the qty value going to the controller is correct.

    Personally, I'd be checking that the setQty function is being fired by the + (plus) & - (minus) buttons, or at least that the setQty function is doing the same thing as the plus & minus buttons are.

    From the code you have posted it looks like this line in the setQty function may be required in the plus & minus button code

    document.getElementById('cart_button_' + id).innerHTML = ''; 
    

提交回复
热议问题