helper = $helper; $this->catalog = $catalog; $this->recommnededHelper = $recommended; $this->priceHelper = $priceHelper; } /** * Get the products to display for table. * * @return array|\Magento\Catalog\Model\ResourceModel\Product\Collection */ public function getLoadedProductCollection() { $params = $this->getRequest()->getParams(); if (! isset($params['code']) || ! $this->helper->isCodeValid($params['code'])) { $this->helper->log('Product push no valid code is set'); return []; } $mode = $this->getRequest()->getActionName(); $limit = $this->recommnededHelper->getDisplayLimitByMode($mode); $productIds = $this->recommnededHelper->getProductPushIds(); $productCollection = $this->catalog->getProductCollectionFromIds($productIds, $limit); //important check the salable product in template return $productCollection; } /** * Display type mode. * * @return boolean|string */ public function getMode() { return $this->recommnededHelper->getDisplayType(); } /** * @param null|string|bool|int|\Magento\Store\Api\Data\StoreInterface $store * * @return string|boolean */ public function getTextForUrl($store) { /** @var \Magento\Store\Model\Store $store */ $store = $this->_storeManager->getStore($store); return $store->getConfig( \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_DYNAMIC_CONTENT_LINK_TEXT ); } }