Jump to content

Recommended Posts

How do I hook the New Products block into the Homepage content beneath the Image Slider and Featured Products? When I click Transplant a module to try to hookin the New Products module into Homepage content displayhome I get the following error This module cannot be transplanted to this hook. I tried changing the position of the New Products Block using live edit but the position change wouldn't take effect. When I selected unhook selection to remove New Products block from the Header of pages but this left things looking really messy in the right column so I restored the hook. I have Prestashop v1.5.3.1 installed on localhost Xampp v1.8.1. Windows 7 Professional 32-bit

Link to comment
Share on other sites

How do I hook the New Products block into the Homepage content beneath the Image Slider and Featured Products? When I click Transplant a module to try to hookin the New Products module into Homepage content displayhome I get the following error This module cannot be transplanted to this hook. I tried changing the position of the New Products Block using live edit but the position change wouldn't take effect. When I selected unhook selection to remove New Products block from the Header of pages but this left things looking really messy in the right column so I restored the hook. I have Prestashop v1.5.3.1 installed on localhost Xampp v1.8.1. Windows 7 Professional 32-bit

 

You will need to open blocknewproducts.php and add:

public function hookDisplayHome($params)
{
 return $this->hookRightColumn($params);
}

Befor or after:

 

public function hookLeftColumn($params)
{
 return $this->hookRightColumn($params);
}

 

Then you'll be able to transplant the module into home page content.

Edited by doubleD (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...
  • 6 months later...

You will need to open blocknewproducts.php and add:

public function hookDisplayHome($params)
{
  return $this->hookRightColumn($params);
}
Befor or after:

 

public function hookLeftColumn($params)
{
  return $this->hookRightColumn($params);
}
Then you'll be able to transplant the module into home page content.

 

 

Hi doubleD, thank you for the nice share :)

Link to comment
Share on other sites

  • 8 months later...

Hi,

 

I want to display new products in my home page like in tab content so in file blocknewproducts.php I add:

public function hookdisplayHome($params)
	{
		if (!$this->isCached('blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home')))
		{
			$this->smarty->assign(array(
					'new_products' => BlockNewProducts::$cache_new_products,
					'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
					'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
			));
		}
		
		if (BlockNewProducts::$cache_new_products === false)
			return false;
		
		return $this->display(__FILE__, 'blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home'));
	}

and the problem is why sometimes it's work and another time don't. Of course I clean cache and add this module to thoose hooks: displayHomeTab, displayHomeTabContent bcs It's work better with this hooks or maybe I have luck. Thanks for help.

 

Kind regards

 

 

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