protected function getProducts()
 {
     $category = new Category((int) Configuration::get('HOME_FEATURED_CAT'));
     $searchProvider = new CategoryProductSearchProvider($this->context->getTranslator(), $category);
     $context = new ProductSearchContext($this->context);
     $query = new ProductSearchQuery();
     $nProducts = Configuration::get('HOME_FEATURED_NBR');
     if ($nProducts < 0) {
         $nProducts = 12;
     }
     $query->setResultsPerPage($nProducts)->setPage(1);
     if (Configuration::get('HOME_FEATURED_RANDOMIZE')) {
         $query->setSortOrder(SortOrder::random());
     } else {
         $query->setSortOrder(new SortOrder('product', 'position', 'asc'));
     }
     $result = $searchProvider->runQuery($context, $query);
     $assembler = new ProductAssembler($this->context);
     $presenterFactory = new ProductPresenterFactory($this->context);
     $presentationSettings = $presenterFactory->getPresentationSettings();
     $presenter = new ProductListingPresenter(new ImageRetriever($this->context->link), $this->context->link, new PriceFormatter(), new ProductColorsRetriever(), $this->context->getTranslator());
     $products_for_template = [];
     foreach ($result->getProducts() as $rawProduct) {
         $products_for_template[] = $presenter->present($presentationSettings, $assembler->assembleProduct($rawProduct), $this->context->language);
     }
     return $products_for_template;
 }