Magento cart not updating quantity in arabic store view

僤鯓⒐⒋嵵緔 提交于 2019-12-05 01:08:21

问题


I have the following issue with a Magento 1.8.1 installation. I have two store views, English, which is default, and Arabic.

In the English store view if I add a product to the shopping cart I am able to modify the quantity by inputing the new quantity in the qty box and clicking Update Shopping Cart, which changes the quantity and the totals.

However, when I switch over to the Arabic store view, I can't update the quantity of any products. I input the desired quantity and press update, but the page reloads with only 1 piece of the product, and the totals are unchanged. I've tested and I've noticed that the cart only updates only for quantities over 31.

I've tried / checked the following:

  1. This line is present in cart.phtml - getBlockHtml('formkey'); ?>
  2. This line is present in cart.phtml - getChildHtml('form_before') ?>
  3. There are no Javascript errors
  4. I am using the default cart functionality, no Ajax or anything else.
  5. I've tried replacing the cart.phtml file with the original one in the base folder, the behavior is the same.
  6. I've tried adding the Store ID to the URL, it didn't fix the issue.
  7. CLeared cache manually.
  8. There are no errors in the php logs.
  9. I've set up Manage stocks in Catalog/Inventory and reindexed, it didn't fix the issue.

Any ideas will be greatly appreciated.

Thanks, Alex


回答1:


Try to remove this code by overriding it on "local"

        if (isset($params['qty'])) {
            $filter = new Zend_Filter_LocalizedToNormalized(
                    array('locale' => Mage::app()->getLocale()->getLocaleCode())
            );
            $params['qty'] = $filter->filter($params['qty']);
        }

from app\code\core\Mage\Checkout\controllers\CartController.php (line 183)

Create to overrride app\code\local\Mage\Checkout\controllers\CartController.php

And remove this also by overriding it on "local"

    if (isset($data['qty'])) {
        $cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
    }

from app\code\core\Mage\Checkout\controllers\CartController.php (line 428)

Create to override app\code\local\Mage\Checkout\controllers\CartController.php

Also remove this by overriding it on "local"

    if (isset($params['qty'])) {
        $filter = new Zend_Filter_LocalizedToNormalized(
            array('locale' => Mage::app()->getLocale()->getLocaleCode())
        );
        $params['qty'] = $filter->filter($params['qty']);
    }

from app\code\core\Mage\Checkout\controllers\CartController.php (line 327)

Create to override app\code\local\Mage\Checkout\controllers\CartController.php



来源:https://stackoverflow.com/questions/22578195/magento-cart-not-updating-quantity-in-arabic-store-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!