Magento货币转换器问题

时间:2014-12-09 08:15:03

标签: php magento currency

我的货币切换器工作正常,直到我在购物车中添加产品。在我的购物车中添加产品后,如果我更改货币,网站会崩溃并给我一个致命的内存错误:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 523800 bytes) in /home/ubuntu/domains/magento/app/code/core/Mage/Core/Model/Config.php on line 1328

1 个答案:

答案 0 :(得分:3)

当您拥有事件sales_quote_collect_totals_beforesales_quote_collect_totals_after的观察者时,可能会发生此错误。在此观察者的方法中,您尝试获取引用对象,例如Mage::getSingleton('checkout/session')->getQuote()。解决方法就是得到这样的引用:

  

public function observerMethod(Varien_Event_Observer $ observer)
  {$ quote = $ observer-> getEvent() - > getQuote(); }