Jump to content

featured category on home page


Recommended Posts

  • 4 weeks later...

but it's really easy to achieve without additional module :|

 

in the homefeatured.php file you've got something like:

 

$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);

 

put the category ID instead the Context::getContext()->shop->getCategory()

 

for example:

$category = new Category(3, (int)Context::getContext()->language->id);

 

code above displays products from category ID = 3

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

thank you for sharing the solution with us.

The code works, but I have another problem: my e-commerce has 2 language, italian and english.

As I select the italian language everyhing is ok, I see the product of the category I choose, instead as I select the english language there is no products in the category.

 

Could you please help me?

 

Thank you in advance,

Regards

Miriam

Link to comment
Share on other sites

  • 5 months later...

but it's really easy to achieve without additional module :|

 

in the homefeatured.php file you've got something like:

 

$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
put the category ID instead the Context::getContext()->shop->getCategory()

 

for example:

$category = new Category(3, (int)Context::getContext()->language->id);
code above displays products from category ID = 3

 

 

 

Is it possible to do this trick for prestashop 1.4.8?

Link to comment
Share on other sites

×
×
  • Create New...