Example #1
0
 function hookRightColumn($params)
 {
     global $smarty;
     if ($special = Product::getRandomSpecial(intval($params['cookie']->id_lang))) {
         $smarty->assign(array('special' => $special, 'oldPrice' => $special['price'] + $special['reduction'], 'mediumSize' => Image::getSize('medium')));
     }
     return $this->display(__FILE__, 'blockspecials.tpl');
 }
 function hookRightColumn($params)
 {
     global $smarty;
     if ($special = Product::getRandomSpecial(intval($params['cookie']->id_lang))) {
         $smarty->assign(array('special' => $special, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'] / (1 + $special['rate'] / 100), 2), 'oldPrice' => $special['price'] + $special['reduction'], 'mediumSize' => Image::getSize('medium')));
     }
     return $this->display(__FILE__, 'blockspecials.tpl');
 }
Example #3
0
 public function hookRightColumn($params)
 {
     if (Configuration::get('PS_CATALOG_MODE')) {
         return;
     }
     if (!($special = Product::getRandomSpecial((int) $params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) {
         return;
     }
     $this->smarty->assign(array('special' => $special, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium'))));
     return $this->display(__FILE__, 'blockspecials.tpl');
 }
Example #4
0
 public function hookHome($params)
 {
     if (Configuration::get('PS_CATALOG_MODE')) {
         return;
     }
     global $smarty;
     $tmp = Product::getPricesDrop(intval($params['cookie']->id_lang));
     asort($tmp);
     if (!($special = Product::getRandomSpecial((int) $params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) {
         return;
     }
     $this->smarty->assign(array('special' => $special, 'specials' => $tmp, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'mediumSize' => Image::getSize('medium_default')));
     return $this->display(__FILE__, 'tmspecials.tpl');
 }
Example #5
0
 public function hookRightColumn($params)
 {
     if (Configuration::get('PS_CATALOG_MODE')) {
         return;
     }
     // We need to create multiple caches because the products are sorted randomly
     $random = date('Ymd') . '|' . round(rand(1, max(Configuration::get('BLOCKSPECIALS_NB_CACHES'), 1)));
     if (!Configuration::get('BLOCKSPECIALS_NB_CACHES') || !$this->isCached('blockspecials.tpl', $this->getCacheId('blockspecials|' . $random))) {
         if (!($special = Product::getRandomSpecial((int) $params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) {
             return;
         }
         $this->smarty->assign(array('special' => $special, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium'))));
     }
     return $this->display(__FILE__, 'blockspecials.tpl', Configuration::get('BLOCKSPECIALS_NB_CACHES') ? $this->getCacheId('blockspecials|' . $random) : null);
 }