Example #1
0
 /**
  * @Vuln\Description("View used: home/home")
  */
 public function action_index()
 {
     $mostPopularProductsCount = 3;
     $bestSellingProductsCount = 3;
     $specialOffersCount = 3;
     $otherCustomerProductCount = 4;
     // Amount of products in the bottom of the page
     $randomProductsCount = 4;
     // Count of reviews after each product section.
     $productSectionReviewCount = 3;
     $product = new Product($this->pixie);
     $special_offers = new SpecialOffers($this->pixie);
     $review = new Review($this->pixie);
     //$this->view->topViewedProducts = $product->getRandomProducts($this->topViewedCount);
     $visitedProductIds = $this->request->cookieWrap('visited_products');
     $this->view->rnd_products = $product->getRndProduct(self::COUNT_RND_PRODUCTS);
     $this->view->relatedToVisitedProducts = $product->getVisitedProducts($visitedProductIds);
     //$product->getRandomProducts($this->relatedToVisitedCount);
     $this->view->bestChoiceProducts = $product->getRandomProducts($this->bestChoiceCount);
     $this->view->mostPopularProducts = $product->getRandomProducts($mostPopularProductsCount);
     $this->view->bestSellingProducts = $product->getRandomProducts($bestSellingProductsCount);
     $this->view->randomProducts = $product->getRandomProducts($randomProductsCount);
     $this->view->special_offers = $special_offers->getRandomOffers($specialOffersCount);
     $this->view->selectedReviews = $review->getRandomReviews($this->reviewsCount);
     $this->view->otherCustomersProducts = $product->getRandomProducts($otherCustomerProductCount);
     $this->view->productSections = array('related_to_viewed' => array('title' => 'Related to Visited', 'products' => $this->view->relatedToVisitedProducts, 'reviews' => count($this->view->relatedToVisitedProducts) ? $review->getRandomReviews($productSectionReviewCount) : array()), 'best_choice' => array('title' => 'Best Choice', 'products' => $this->view->bestChoiceProducts, 'reviews' => count($this->view->bestChoiceProducts) ? $review->getRandomReviews($productSectionReviewCount) : array()), 'random' => array('title' => "", 'products' => $this->view->randomProducts));
     $this->view->topProductBlocks = array('most_popular' => array('title' => "Top {$bestSellingProductsCount} most popular", 'products' => $this->view->mostPopularProducts), 'best_selling' => array('title' => "Top {$bestSellingProductsCount} best selling", 'products' => $this->view->bestSellingProducts));
     $this->view->common_path = $this->common_path;
     $this->view->subview = 'home/home';
     $this->view->message = "Index page";
 }