Update Cart Not Working On Magento 1.9?

Magento Web Design



We recently upgraded a Magento website for a client from version 1.4 to the most recent version (at the time), version 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:

<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>

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 echo $this->getBlockHtml('formkey'); ?>

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

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

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.

Magento Web Design