Magento Checkout – Fixing Quantity Issue in Shopping Cart

checkoutdatabasemagento-1.8shopping-cart

I have installed Magento 1.8.0 and on localhost the cart is working correctly. I change the quantity of a product in the cart then I push the "Update cart" button and all works fine. I trasferred the site online and the cart quantity doesn't work anymore. As I change the quantity of a product and click the button the quantity remains the same. If I go back and try to add the same product to the cart, even if I specify a different quantity like 10 and not 1, in the cart only 1 item is added every time I click on "add to the cart" button and not 10 as specified. I cannot figure out where's the problem. I excluded my custom theme and rolled back to the default theme and the problem persist. I updated magento to 1.8.1 and the same problem.

No logs. Nothing.

Best Answer

In your theme directory

In your /app/design/frontend/yourthemepackage/default/template/checkout/cart.phtml file or /app/design/frontend/default/yourtheme/template/checkout/cart.phtml file

Just place on line 50 just after getUrl('checkout/cart/updatePost') ?>" method="post"> paste the below code

<?php echo $this->getBlockHtml('formkey'); ?>

it will work fine now.