public function install()
 {
     if (!parent::install() || !$this->registerHook('displayHomeLine5')) {
         return false;
     }
     return true;
 }
Example #2
0
 public function hookRightColumn($params)
 {
     if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'))) {
         if (BlockBestSellers::$cache_best_sellers === null) {
             BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
         }
         $this->smarty->assign(array('best_sellers' => BlockBestSellers::$cache_best_sellers, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'smallSize' => Image::getSize(ImageType::getFormatedName('small'))));
     }
     return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'));
 }
Example #3
0
 public function hookRightColumn($params)
 {
     if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'))) {
         if (!isset(BlockBestSellers::$cache_best_sellers)) {
             BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
         }
         $this->smarty->assign(array('best_sellers' => BlockBestSellers::$cache_best_sellers, 'display_link_bestsellers' => Configuration::get('PS_DISPLAY_BEST_SELLERS'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'smallSize' => Image::getSize(ImageType::getFormatedName('small'))));
     }
     if (BlockBestSellers::$cache_best_sellers === false) {
         return false;
     }
     return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'));
 }
 public function hookRightColumn($params)
 {
     if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'))) {
         if (!isset(BlockBestSellers::$cache_best_sellers)) {
             $newBestSeller = BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
         }
         foreach ($newBestSeller as $key => $value) {
             $seller_id = $value['id_seller'];
             $id_image = $value['id_image'];
             $flagIds = self::getFlagsId($seller_id);
             foreach ($flagIds as $k => $flgId) {
                 $newBestSeller[$key]['img_exist'][$k] = file_exists(_PS_ROOT_DIR_ . DS . 'flag' . DS . 'mini' . DS . $flgId . '.jpg') ? 1 : 0;
                 $newBestSeller[$key]['img_name'][$k] = $flgId . '.jpg';
             }
             $id_image_exp = explode("-", $id_image);
             unset($id_image_exp[0]);
             $id_image_new = implode("-", $id_image_exp);
             $newBestSeller[$key]['id_image'] = $id_image_new;
         }
         $this->smarty->assign(array('best_sellers' => $newBestSeller, 'display_link_bestsellers' => Configuration::get('PS_DISPLAY_BEST_SELLERS'), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'smallSize' => Image::getSize(ImageType::getFormatedName('small'))));
     }
     if (BlockBestSellers::$cache_best_sellers === false) {
         return false;
     }
     return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId('blockbestsellers-col'));
 }