Jump to content

Bug affichage aléatoire du bloc promotions


Recommended Posts

Bonjour,

 

Sur mon site (www.laboderm.fr), le bloc Promotions affiche toujours les mêmes produits en page d'accueil, triés du plus au moins cher.

Comment faire pour qu'ils s'affichent au hasard ?

 

Ci dessous le code pour l'affichage du hook sur la homepage

	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'));
	}

Merci d'avance de votre aide !

Edited by hansou (see edit history)
Link to comment
Share on other sites

ok...

Alors remplacez :

		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'));

par

		BlockSpecials::$cache_specials = Product::getPricesDrop((int)$params['cookie']->id_lang, 0, Configuration::get('BLOCKSPECIALS_SPECIALS_NBR'));

Comme ça il n'utilise plus le cache de la dernière requête^^

Link to comment
Share on other sites

  • 1 month later...
  • 4 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...