Magento cart not updating quantity in arabic store

2019-03-30 21:35发布

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条回答
疯言疯语
2楼-- · 2019-03-30 21:57

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

查看更多
登录 后发表回答