Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento. Quantity in checkout shopping cart doesn't work properly

Tags:

magento

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.

like image 992
Claudio Ferraro Avatar asked Jan 04 '14 00:01

Claudio Ferraro


2 Answers

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.

P.S. for more information you can check same answer on http://magento-online-tutorials.blogspot.in/2015/11/shopping-cart-quantity-not-able-to.html

like image 170
Pradeep Sanku Avatar answered Nov 08 '22 23:11

Pradeep Sanku


Those who have upgraded their Magento to 1.8 must have following line in

app\design\frontend\default\customtheme\template\checkout\cart.phtml

  <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
    <?php echo $this->getBlockHtml('formkey'); ?>  // this line must be there
like image 27
Mukesh Avatar answered Nov 08 '22 23:11

Mukesh