_customerFactory = $customerFactory; $this->_customerRepository = $customerRepository; parent::__construct( $context, $coreRegistry, $customerSession, $wishlistFactory, $storeManager, $postDataHelper, $customerViewHelper, $wishlistProvider, $productRepository ); } /** * Retrieve Wishlist model * * @return \Magento\Wishlist\Model\Wishlist */ public function getWishlist() { if ($this->_wishlist === null) { $this->_wishlist = $this->_wishlistFactory->create(); $wishlistId = $this->_getRequest()->getParam('wishlist_id'); if ($wishlistId) { $this->_wishlist->load($wishlistId); } else { if ($this->getCustomer()->getId()) { $this->_wishlist->loadByCustomerId($this->getCustomer()->getId()); } } } return $this->_wishlist; } /** * Retrieve Customer instance * * @return \Magento\Customer\Api\Data\CustomerInterface */ public function getCustomer() { if ($this->_customer === null) { $params = $this->urlDecoder->decode($this->_getRequest()->getParam('data')); $data = explode(',', $params); $customerId = abs((int)$data[0]); if ($customerId && ($customerId == $this->_customerSession->getCustomerId())) { $this->_customer = $this->_customerRepository->getById($customerId); } else { $this->_customer = $this->_customerFactory->create(); } } return $this->_customer; } /** * Is allow RSS * * @return bool */ public function isRssAllow() { return $this->_moduleManager->isEnabled('Magento_Rss') && $this->scopeConfig->isSetFlag( 'rss/wishlist/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); } }