Magento“无法将商品添加到购物车中。”没有明显的理由

问题描述 投票:2回答:4

我有一个奇怪的问题,我需要你的帮助。

我的服务器上有三个独立的Magento安装。其中两个在SSL证书下:https://apps.domain.com/store1&https://apps.domain.com/store2。这两个商店如何定制主题。第三个安装是域的根目录上的全新安装,没有SSL证书,如:http:// www.domain.com/store3

会发生的是,突然之间,所有三家商店都停止向购物车添加商品并向我提出此错误“无法将商品添加到购物车中”。然后一小时或几个小时左右,添加到购物车按钮再次开始工作。奇怪的是,我没有改变任何东西使它工作或停止工作,他们都工作或停止同时工作。

请指教!

更新:

实际上我在我的异常日志中找到了这个:

2014-07-27T21:09:35+00:00 DEBUG (7): Exception message: Notice: Undefined offset: 2  in /home/---/store2/lib/Zend/Locale/Format.php on line 577
Trace: #0 /home/---/store2/lib/Zend/Locale/Format.php(577): mageCoreErrorHandler(8, 'Undefined offse...', '/home/vmegypt/p...', 577, Array)
1 /home/---/store2/lib/Zend/Locale/Format.php(513): Zend_Locale_Format::_getRegexForType('decimalnumber', Array)
2 /home/---/store2/lib/Zend/Filter/LocalizedToNormalized.php(100): Zend_Locale_Format::isNumber('3', Array)
3 /home/---/store2/app/code/core/Mage/Checkout/controllers/CartController.php(187): Zend_Filter_LocalizedToNormalized->filter('3')
4 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->addAction()
5 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('add')
6 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
7 /home/---/store2/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
8 /home/---/store2/app/Mage.php(683): Mage_Core_Model_App->run(Array)
9 /home/---/store2/index.php(117): Mage::run('', 'store')
10 {main}
2014-07-27T21:09:35+00:00 ERR (3): 
exception 'Exception' with message 'Notice: Undefined offset: 2  in /home/---/store2/lib/Zend/Locale/Format.php on line 577' in /home/---/store2/app/code/core/Mage/Core/functions.php:245
Stack trace:
0 /home/---/store2/lib/Zend/Locale/Format.php(577): mageCoreErrorHandler(8, 'Undefined offse...', '/home/vmegypt/p...', 577, Array)
1 /home/---/store2/lib/Zend/Locale/Format.php(513): Zend_Locale_Format::_getRegexForType('decimalnumber', Array)
2 /home/---/store2/lib/Zend/Filter/LocalizedToNormalized.php(100): Zend_Locale_Format::isNumber('3', Array)
3 /home/---/store2/app/code/core/Mage/Checkout/controllers/CartController.php(187): Zend_Filter_LocalizedToNormalized->filter('3')
4 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->addAction()
5 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('add')
6 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
7 /home/---/store2/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
8 /home/---/store2/app/Mage.php(683): Mage_Core_Model_App->run(Array)
9 /home/---/store2/index.php(117): Mage::run('', 'store')
10 {main}

magento cart
4个回答
0
投票

无论如何,这是好事。你这里没有提供太多的信息,很难猜出它本来可以是什么。检查magento和服务器日志,也许你会在那里找到答案。


0
投票

在我看来,它与会话有关。如果您实际查看CartController.php中的函数addAction,您将看到此错误的来源。所以请尝试调试,在addAction方法的try块中调试异常。您可以使用var_dump直到看到代码中断的位置


0
投票

我通过在magento 1.7修复表sales_flat_quote_item_option中修复一个表来解决了这个问题;


0
投票

虽然我的解决方案似乎是独一无二的,但我想我会分享我的个人解决方案,以防有人遇到类似的情况。最终,数据库中缺少一些表,我的客户端意外丢失了。我从备份恢复它们,一切正常。这个错误有很多原因,与最近的备份相比,可能值得检查表的数量。

© www.soinside.com 2019 - 2024. All rights reserved.