Magento – Magento 1.7.0.2 – Subtotal and grand total doubled in cart

cartcheckoutmagento-1.7

A few customers have complained that they are getting subtotal and grand total prices that are double of what they should be. After some tests, I've found that when a user adds a product to cart, go to checkout, then changes his mind and removes the item from the cart – the next time he will add a product to the cart, the subtotal and grand total prices will get doubled. It happened only in IE and Firefox, not in Chrome.

I've found this post: https://web.archive.org/web/20150227130454/http://www.magentocommerce.com/boards%20/viewthread/227560/P0/

I've checked the DB table sales_flat_quote_address and saw there were quote ids that had more than one shipping and billing address.

I implemented the solution that is shown in this post: https://web.archive.org/web/20150227035906/http://www.magentocommerce.com/boards%20/viewthread/227560/P15/#t393997

and the price is no longer getting doubled in the situation I described above.

The problem is that since this fix I still get occasionally a complaint from customers about the price being doubled and I see the same situation in the DB table sales_flat_quote_address, but I can't reproduce this issue so I don't know when it happens.

Any ideas what I can do?

Best Answer

I'm working on the same problem. I also don't know what the root cause of the issue is, but have an idea for why you are still seeing some stragglers after your code change.

The init() method is called in the CartController::indexAction(). So it only runs when the customer loads the cart page. If you have some kind mini-cart widget on your site--anything that shows the current subtotal but isn't the full-on cart page--then the subtotal will still be double in the mini-cart whenever there are duplicate addresses. If that's the case, it should be fixed as soon as the customer goes to the cart page.