Jump to content

[solved] New Products on home page for 1.5


Recommended Posts

in this case you have to edit module class (.php file)

 

in the file search for:

public function hookDisplayHome($params)

this is function which displays the block.

 

you've got there something like this:

$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10));

 

change it to:

$products = Product::getNewProducts((int)($params['cookie']->id_lang), 0, $nb);

Link to comment
Share on other sites

 

in this case you have to edit module class (.php file)

 

in the file search for:

public function hookDisplayHome($params)

this is function which displays the block.

 

you've got there something like this:

$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10));

 

change it to:

$products = Product::getNewProducts((int)($params['cookie']->id_lang), 0, $nb);

 

 

Hello! Vekia,

 

To show new products there is module provided by default in prestashop, But it only shows product to right and left column..

 

If one wants to show new products on home page with slider then as you said there is nothing found blocknewproducts.php file...

 

What to do??

Link to comment
Share on other sites

in this case you have to modify the source code a bit, you need to add support of the home hook, then create separate tempalte file with sources similar to the homefeatured module.

 

and of course reinstall the module

Link to comment
Share on other sites

×
×
  • Create New...