2013-05-14 24 views
0

工作在我Observer.php我存儲會話Magento的會議不工作的服務器,但在localhost

$itemAddedToCart = 'true'; 
    Mage::getSingleton('core/session')->setItemAddedToCart($itemAddedToCart); 

變量當我嘗試找回它:

Mage::getSingleton('core/session')->getItemAddedToCart(); 

這是始終爲NULL。 奇怪的是它在我的本地開發環境(MAMP)中正常工作。爲什麼它不在服務器上工作?嘗試Dreamhost和Magento託管公司。

在此先感謝!

+0

更多信息:我認爲這事做不區分大小寫以及未正確加載文件。我可以讓會話在另一個文件中工作。 –

回答

0

已成爲區分大小寫的問題。 在我的Mac上,事情正常工作,因爲mac忽略文件夾/文件的情況。 在Linux服務器上,由於linux使用區分大小寫的文件系統,因此無法正常工作。

在我的情況下,在config.xml我不得不改變從這個類節點:

 <checkout_cart_product_add_after> 
      <observers> 
       <mymodule_modulator_model_observer> 
        <type>singleton</type> 
        <class>Mymodule_Modulator_Model_Observer</class> 

要這樣:

<class>MyModule_Modulator_Model_Observer</class> 
     ^Changed to upper case to match folder name 
相關問題