Jump to content

Show homefeeatured in another HOOK


Recommended Posts

I want to create a new HOOK or display the homefeatured module at the bottom of the categories page.

 

 

In the file homefeatured.php
 
In the function install 
You need to register a hook for example - displayCategoryFeatured
 
	public function install()
	{
		$this->_clearCache('*');
		Configuration::updateValue('HOME_FEATURED_NBR', 8);
		Configuration::updateValue('HOME_FEATURED_CAT', (int)Context::getContext()->shop->getCategory());
		Configuration::updateValue('HOME_FEATURED_RANDOMIZE', false);

		if (!parent::install()
			|| !$this->registerHook('header')
			|| !$this->registerHook('addproduct')
			|| !$this->registerHook('updateproduct')
			|| !$this->registerHook('deleteproduct')
			|| !$this->registerHook('categoryUpdate')
			|| !$this->registerHook('displayHomeTab')
			|| !$this->registerHook('displayCategoryFeatured')
			|| !$this->registerHook('displayHomeTabContent')
		)
			return false;

		return true;
	}

Then in the same file add new function

	public function hookDisplayCategoryFeatured()
	{
		return $this->hookDisplayHome();
	}
Then you need to reinstall the module
 
And add the hook to the category.tpl theme file
 
{hook h='displayCategoryFeatured'}

 

 

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