/** * Show also bought articles */ public function boughtAction() { $articleId = (int) $this->Request()->getParam('articleId'); $maxPages = (int) $this->config->get('alsoBoughtMaxPages', 10); $perPage = (int) $this->config->get('alsoBoughtPerPage', 4); $this->marketingModule->sBlacklist[] = $articleId; $articles = $this->marketingModule->sGetAlsoBoughtArticles($articleId, $maxPages * $perPage); $numbers = array_column($articles, 'number'); $result = $this->getPromotions($numbers); $this->View()->maxPages = $maxPages; $this->View()->perPage = $perPage; $this->View()->boughtArticles = $result; }
/** * Show also bought articles */ public function boughtAction() { $articleId = (int) $this->Request()->getParam('articleId'); $maxPages = (int) $this->config->get('alsoBoughtMaxPages', 10); $perPage = (int) $this->config->get('alsoBoughtPerPage', 4); $this->marketingModule->sBlacklist[] = $articleId; $articles = $this->marketingModule->sGetAlsoBoughtArticles($articleId, $maxPages * $perPage); foreach ($articles as $article) { $article = $this->articleModule->sGetPromotionById('fix', 0, (int) $article['id']); if (!empty($article['articleName'])) { $result[] = $article; } } $this->View()->maxPages = $maxPages; $this->View()->perPage = $perPage; $this->View()->boughtArticles = $result; }