Jump to content

Override In 1.5.3.1


Recommended Posts

Hi everybody;

 

There is an example in Prestashop user guide about overriding. I totaly copy and paste the example-3 from here and apply to my site but it didn't work.

 

When I debug a page there is no variable whic is called $currentController.

 

The example is below:

 

 

/*
* With this override, you have a new Smarty variable called "currentController" available in header.tpl
* This allows you to use a different header if you are on a product page, category page or home.
*/
class FrontController extends FrontControllerCore {
public function displayHeader()
{
	self::$smarty->assign('currentController', get_class($this));
	return parent::displayHeader();
}
}

 

Force compile is active, cache is disable.

 

I tried this in two new local site but it didn't work.

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

Thanks you so much. But I know it works with this way. Is overriding to deprecated functions not possible?

 

Why they put an example to userguide like this If it doesn't work?

 

I want to use a variable in header.tpl so I select to override displayHeader.

If displayHeader() is a deprecated function what should I use instead of this?

Link to comment
Share on other sites

×
×
  • Create New...