2015-02-11 51 views
4

我有一個magento 1.7.2網站,並且我只能添加一個產品到wishlist.when我添加第二個然後它取代了第一個。當我評論以下幾行代碼在模型/ Wishlist.php它工作正常。無法添加多個產品到心願

protected function _afterSave() 
    { 
     parent::_afterSave(); 
     if (null !== $this->_itemCollection) { 
      //$this->getItemCollection()->save(); //commented this line 
     } 
     return $this; 
    } 

回答

3

我正面臨同樣的問題,當我們運行帶有1個網站和2個商店的Magento時,這個問題大多發生。

在應用程序/代碼/核心/法師/收藏/型號/ Wishlist.php 發現:

public function getItemCollection() 

,改變

$this->_itemCollection = Mage::getResourceModel('wishlist/item_collection') 
->addWishlistFilter($this) 
->addStoreFilter($this->getSharedStoreIds($currentWebsiteOnly)) 
->setVisibilityFilter(); 

$this->_itemCollection = Mage::getResourceModel('wishlist/item_collection') 
->addWishlistFilter($this) 
->addStoreFilter($this->getSharedStoreIds($currentWebsiteOnly)); 

這將刪除從添加到心願單的項目中查看過濾器,因此所有添加到心願單中的項目都將顯示。

更多細節在,

https://sarfarazlaghari.wordpress.com/2013/12/06/magento-wishlist-shows-online-1-product/

https://magento.stackexchange.com/questions/34700/wishlist-shows-only-one-item

相關問題