115 \
Magento\Framework\Registry $coreRegistry,
116 \
Magento\Customer\Model\Session $customerSession,
117 \
Magento\Wishlist\Model\WishlistFactory $wishlistFactory,
119 \
Magento\Framework\
Data\Helper\PostHelper $postDataHelper,
120 \
Magento\Customer\Helper\View $customerViewHelper,
124 $this->_coreRegistry = $coreRegistry;
125 $this->_customerSession = $customerSession;
126 $this->_wishlistFactory = $wishlistFactory;
128 $this->_postDataHelper = $postDataHelper;
129 $this->_customerViewHelper = $customerViewHelper;
132 parent::__construct($context);
142 return $this->_customerSession->isLoggedIn();
173 if (!$this->_currentCustomer && $this->_customerSession->isLoggedIn()) {
174 $this->_currentCustomer = $this->_customerSession->getCustomerDataObject();
186 if ($this->_wishlist ===
null) {
187 if ($this->_coreRegistry->registry(
'shared_wishlist')) {
188 $this->_wishlist = $this->_coreRegistry->registry(
'shared_wishlist');
190 $this->_wishlist = $this->wishlistProvider->getWishlist();
205 $storedDisplayType = $this->_customerSession->getWishlistDisplayType();
206 $currentDisplayType = $this->scopeConfig->getValue(
207 self::XML_PATH_WISHLIST_LINK_USE_QTY,
208 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
211 $storedDisplayOutOfStockProducts = $this->_customerSession->getDisplayOutOfStockProducts();
212 $currentDisplayOutOfStockProducts = $this->scopeConfig->getValue(
213 self::XML_PATH_CATALOGINVENTORY_SHOW_OUT_OF_STOCK,
214 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
216 if (!$this->_customerSession->hasWishlistItemCount() ||
217 $currentDisplayType != $storedDisplayType ||
218 $this->_customerSession->hasDisplayOutOfStockProducts() ||
219 $currentDisplayOutOfStockProducts != $storedDisplayOutOfStockProducts
224 return $this->_customerSession->getWishlistItemCount();
244 if ($this->_wishlistItemCollection ===
null) {
266 if (
$product->isVisibleInSiteVisibility()) {
274 return $this->_storeManager->getStore(
$storeId);
294 return $this->_postDataHelper->getPostData(
$url,
$params);
306 'wishlist/index/configure',
308 'id' =>
$item->getWishlistItemId(),
309 'product_id' =>
$item->getProductId()
336 return $this->_postDataHelper->getPostData(
$url,
$params);
350 return $this->_postDataHelper->getPostData(
$url,
$params);
364 $itemId =
$item->getWishlistItemId();
368 $itemId =
$item->getId();
372 $url = $this->
_getUrl(
'wishlist/index/updateItemOptions');
375 return $this->_postDataHelper->getPostData(
$url,
$params);
408 return $this->_postDataHelper->getPostData(
423 $this->urlEncoder->encode($this->
_getRequest()->getServer(
'HTTP_REFERER'));
435 return $this->_postDataHelper->getPostData(
448 return $this->_postDataHelper->getPostData(
449 $this->_storeManager->getStore()->getUrl(
'*/*/allcart', [
'_current' =>
true])
480 $params[
'wishlist_id'] = $wishlistId;
492 if ($this->_moduleManager->isOutputEnabled($this->_getModuleName()) && $this->scopeConfig->getValue(
493 'wishlist/general/active',
494 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
520 ? $this->_customerViewHelper->getCustomerName($this->
getCustomer())
535 $params = [
'data' => $this->urlEncoder->encode($key),
'_secure' =>
false];
538 $params[
'wishlist_id'] = $wishlistId;
550 return __(
'Comment');
560 return __(
'Wish List');
575 if ($this->scopeConfig->getValue(
576 self::XML_PATH_WISHLIST_LINK_USE_QTY,
577 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
584 $this->_customerSession->setWishlistDisplayType(
585 $this->scopeConfig->getValue(
586 self::XML_PATH_WISHLIST_LINK_USE_QTY,
587 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
590 $this->_customerSession->setDisplayOutOfStockProducts(
591 $this->scopeConfig->getValue(
592 self::XML_PATH_CATALOGINVENTORY_SHOW_OUT_OF_STOCK,
593 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
597 $this->_customerSession->setWishlistItemCount(
$count);
598 $this->_eventManager->dispatch(
'wishlist_items_renewed');
609 return $this->scopeConfig->getValue(
610 self::XML_PATH_WISHLIST_LINK_USE_QTY,
611 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
633 $product = $this->productRepository->getById(
636 $this->_storeManager->getStore()->getStoreId()
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Customer\Helper\View $customerViewHelper, WishlistProviderInterface $wishlistProvider, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository)
setCustomer(\Magento\Customer\Api\Data\CustomerInterface $customer)
getAddToCartParams($item, $addReferer=false)
const XML_PATH_WISHLIST_LINK_USE_QTY
_getCartUrlParameters($item)
const XML_PATH_CATALOGINVENTORY_SHOW_OUT_OF_STOCK
getListUrl($wishlistId=null)
const PARAM_NAME_URL_ENCODED
getMoveFromCartParams($itemId)
_getUrl($route, $params=[])
_createWishlistItemCollection()
foreach($product->getExtensionAttributes() ->getBundleProductOptions() as $option) $buyRequest
getProductUrl($item, $additional=[])
getAddParams($item, array $params=[])
getRemoveParams($item, $addReferer=false)
getSharedAddToCartUrl($item)
addRefererToParams(array $params)
getRssUrl($wishlistId=null)
getWishlistItemCollection()
getSharedAddAllToCartUrl()
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]