Jump to content

Ajouter un hook au module Blockspecials


Recommended Posts

Bonjour

 

J'aimerai afficher le module Promotions (blockspecials) dans le hook DisplayHome.

 

J'ai créé un fichier ainsi : 

 

override/modules/blockspecials/blockspecials.php

 

Contenant

class BlockSpecialsOverride extends BlockSpecials
{	
	public function hookDisplayHome($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'));
	}
	}

Je me retrouve avec un message sur le front et l'admin de mon site, et le module en carafe.

class BlockSpecialsOverride extends BlockSpecials { public function hookDisplayHome($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')); } }

 

Une idée ?

Merci

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More