/** * 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; }
/** * Get all articles and a table of their properties as an array * @return array Associative array with all articles or empty array */ public function sGetComparisonList() { if (!$this->session->offsetGet('sessionId')) { return []; } $articles = []; // Get all comparisons for this user $checkForArticle = $this->db->fetchAll("SELECT * FROM s_order_comparisons WHERE sessionID=?", [$this->session->offsetGet('sessionId')]); if (!count($checkForArticle)) { return []; } foreach ($checkForArticle as $article) { if ($article["articleID"]) { $articles[] = $this->articleModule->sGetPromotionById("fix", 0, (int) $article["articleID"]); } } $properties = $this->sGetComparisonProperties($articles); $articles = $this->sFillUpComparisonArticles($properties, $articles); return ["articles" => $articles, "properties" => $properties]; }