kondor75 Posted February 13, 2015 Share Posted February 13, 2015 (edited) Ciao a tutti, vorrei rendermi utile alla community, qualora già non esistesse una guida/tutorial per il tab offerte speciali, per la creazione in HomePage del Tab Offerte Speciali, che andrà quindi ad affiancarsi a Nuovi Arrivi, Prodotti in vetrina e I più venduti. E' molto semplice e veloce: a. creare tab.tpl come segue: modules/blockspecials/tab.tpl : <li><a data-toggle="tab" href="#blockspecials" class="blockspecials">{l s='Specials' mod='blockspecials'}</a></li> b. sostituire il testo che segue modules/blockspecials/blockspecials.php with hooks : public function hookDisplayHomeTab($params) { if (Configuration::get('PS_CATALOG_MODE')) return; if (!$this->isCached('tab.tpl', $this->getCacheId('blockspecials-tab'))) BlockSpecials::$cache_specials = Product::getPricesDrop((int)$params['cookie']->id_lang, 0, Configuration::get('BLOCKSPECIALS_SPECIALS_NBR')); if (BlockSpecials::$cache_specials === false) return false; return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blockspecials-tab')); } public function hookDisplayHomeTabContent($params) { if (Configuration::get('PS_CATALOG_MODE')) return; if (!$this->isCached('blockspecials-home.tpl', $this->getCacheId('blockspecials-home'))) { $this->smarty->assign(array( 'specials' => BlockSpecials::$cache_specials, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')) )); } if (BlockSpecials::$cache_specials === false) return false; return $this->display(__FILE__, 'blockspecials-home.tpl', $this->getCacheId('blockspecials-home')); } BO: moduli → posizioni → Innestare Modulo → selezionare Blocco Offerte Speciali e associarlo con displayHomeTab (home page tabs) → Salva; selezionare Blocco Offerte Speciali e associarlo con displayHomeTabContent → Salva Attendere 15s-20s e refreshare la Homepage; se non compare nulla creare un prodotto in offerta. Buon lavoro a tutti. Edited February 13, 2015 by kondor75 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now