Jump to content

Ne pas afficher le bloc promotion si pas de promo


Recommended Posts

2 hours ago, Eolia said:

Modifier le code du module^^

 

Mais normalement il ne devrait pas


if (BlockSpecials::$cache_specials === false)
			return false;

 

Je n'ai pas cette ligne, dans le fichier php.

ce n'est pas le module d'origine, c'est un module qui n'est plus suivie qui propose l'affichage des nouveauté, meilleure vente et promo.

Le problème, c'est que quand il n y a pas de nouveautés, ou promos, le titre nouveau ou promo s'affiche quand même.

 

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

Dans le module d'origine:

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

Inspirez vous de ce code dans votre module.  Si pas de résultats, return false;

Link to comment
Share on other sites

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...