4 October, 2023

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.

Alex Sam is a digital marketer by choice & profession. He munches on topics relating to technology, eCommerce, enterprise mobility, Cloud Solutions and Internet of Things. His other interests lies in SEO, Online Reputation Management and Google Analytics. Follow Me Socially: Habr , Dev.to & Viblo .

2 Comments

Leave a Reply

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