How to bug fix ‘Shopping Cart Quantity Update’ in Arabic Store View – Magento

In this blog I would like to share a useful solution which I found out for a problem which I experienced in a Magento powered store.

Problem: I worked on an Ecommerce store which had both English and Arabic store view. In the Arabic store view, after changing the quantity number from 1 to 2 and clicking the ‘Update Shopping Cart’ button, the reloaded page did not show the updated figure in the ‘Quantity’ area and I did not receive an error message too. While testing for the same scenario in English store view, it worked perfectly. Upon searching for a route to fix this technical issue, I came across this solution which I have shared through this blog. I’d like all developers to have a look at it and get benefitted.

The following path has to be followed and the necessary changes have to be made in order to solve the above mentioned issue.

Read: How to Create Multilingual Website in Magento

File Path: app/code/core/Mage/Checkout/controllers/controllers/CartController.php

<?php
require_once "Mage/Checkout/controllers/CartController.php";
class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action
{
public function addAction()
    {
//  Remove this Code (line 175)
/*	 if (isset($params['qty'])) {
                	$filter = new Zend_Filter_LocalizedToNormalized(
                    	array('locale' => Mage::app()->getLocale()->getLocaleCode()));
                $params['qty'] = $filter->filter($params['qty']);
            }
	*/
    }
public function updateItemOptionsAction()
    { 	
//  Remove this Code (line 317)
	/*	  if (isset($params['qty'])) {
               $filter = new Zend_Filter_LocalizedToNormalized(
              array('locale' => Mage::app()->getLocale()->getLocaleCode()));
                $params['qty'] = $filter->filter($params['qty']);
         }*/
	}
protected function _updateShoppingCart()
    {
//  Remove this Code (line 413)
 /*	 if (isset($data['qty'])) { 
                        $cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
                    }
*/
	}			
}
?>

The above mentioned solution has resolved the quantity updating problem on shopping cart in the Arabic store view too. Hope this will help if everybody who are experiencing this same issue. Thank you! Kindly Refresh magento Cache and Re-index Data. Then check your shopping cart. It works perfectly. It would be great if you could share any of your ideas or ask questions regarding your issues currently faced in Magento development. We would be glad to share our information and help you out.

Related posts

2 thoughts on “How to bug fix ‘Shopping Cart Quantity Update’ in Arabic Store View – Magento

  1. John Freddy Gallego

    Hey thanks a lot for this solution work for me on magento 1.9.2.4 with spanish language.

    • Ramanathan

      Dear John Freddy,

      Good to hear from you! Check our updated blogs too.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">