Exemple #1
0
 public function _cacheProducts()
 {
     if (!isset(HomeFeatured::$cache_products)) {
         $category = new Category((int) Configuration::get('HOME_FEATURED_CAT'), (int) Context::getContext()->language->id);
         $nb = (int) Configuration::get('HOME_FEATURED_NBR');
         if (Configuration::get('HOME_FEATURED_RANDOMIZE')) {
             HomeFeatured::$cache_products = $category->getProducts((int) Context::getContext()->language->id, 1, $nb ? $nb : 8, null, null, false, true, true, $nb ? $nb : 8);
         } else {
             HomeFeatured::$cache_products = $category->getProducts((int) Context::getContext()->language->id, 1, $nb ? $nb : 8, 'position');
         }
     }
     if (HomeFeatured::$cache_products === false || empty(HomeFeatured::$cache_products)) {
         return false;
     }
 }
 public function _cacheProducts()
 {
     if (!isset(HomeFeatured::$cache_products)) {
         $category = new Category(Context::getContext()->shop->getCategory(), (int) Context::getContext()->language->id);
         $nb = (int) Configuration::get('HOME_FEATURED_NBR');
         HomeFeatured::$cache_products = $category->getProducts((int) Context::getContext()->language->id, 1, $nb ? $nb : 8, 'position');
     }
     if (HomeFeatured::$cache_products === false || empty(HomeFeatured::$cache_products)) {
         return false;
     }
 }