无法将多个产品添加到心愿单

  • 本文关键字:添加 心愿 magento-1.7
  • 更新时间 :
  • 英文 :


我有一个magento 1.7.2网站,因为我只能向愿望列表中添加一个产品。当我添加第二个产品时,它会取代第一个。当我在model/Wishlist.php中注释以下代码行时,它工作得很好。

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

我也遇到了同样的问题,这个问题主要发生在我们用1个网站和2个商店运行Magento时。

应用程序内/code/core/Mage/Wishlist/Model/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

最新更新