Update Cart Not Working On Magento 1.9?

Posted By: Proper Noun Staff Posted On: May 1, 2021 Share:

We recently upgraded a Magento website for a client from version 1.4 to the most recent version (at the time), version 1.9.0.1. Once we were able to resolve the major issues from the upgrade, there were still quite a few minor issues that took some time to recognize. One of these issues was that the "Update Cart" button was not affecting the cart quantity.

The first place to look was the file that contained the update cart button, which is within the folder app/design/frontend/rwd/THEME NAME/template/checkout/cart.php. Once the file is opened, look somewhere around line 100 for the button, which should look like this:

[php]
<button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
[/php]

If your button is already set up properly, it's likely your checkout form is missing or has an incorrect form key, which is required for the form to validate. First, search your template for the string 'formkey' to either locate it on your template, or confirm it is missing all together. If it is there, it's likely the entire snippet looks something like this:

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

If so, you can either comment this out, edit it, or remove it all together so that it can be replaced by:

[php]
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>"/>
[/php]

If you can't find the string 'formkey' anywhere in your document, you will just need to add in the above snippet into the form on cart.phtml. You can find the closing fieldset for the form around line 117 and paste it in just before it.

Once your file is updated to include the correct key, recheck your "Update Cart" button and everything should be working as needed.

Proper Noun Staff

Proper Noun Staff

In-House Writing Team

Read informative articles, insights, and other resources right from the experts on the Proper Noun team.

Copyright © Proper Noun 2024