コード例 #1
0
ファイル: Wishlist.php プロジェクト: pradeep-wagento/magento2
 /**
  * Retrieve wishlist item collection
  *
  * @return \Magento\Wishlist\Model\ResourceModel\Item\Collection
  */
 public function getItemCollection()
 {
     if ($this->_itemCollection === null) {
         $this->_itemCollection = $this->_wishlistCollectionFactory->create()->addWishlistFilter($this)->addStoreFilter($this->getSharedStoreIds())->setVisibilityFilter();
     }
     return $this->_itemCollection;
 }
コード例 #2
0
 /**
  * Prepare collection.
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_collectionFactory->create()->addCustomerIdFilter($this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID))->addDaysInWishlist()->addStoreData()->setInStockFilter(true);
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }