Jump to content

List category products in home page


Recommended Posts

Hello:

 

I'm looking for a block module like the "home featured" module, but I need to put 2 or 3 of them.

 

I want to create a new category (Holidays, f.i) and add some products in that category. After that, I want to add a new block in the home page showing the products of that category with a custom title.

 

This way, I can have several "highlights block products" in the home page.

 

Do you know any module doing this? Or something like this?

 

Thank you very much

Share this post


Link to post
Share on other sites

Hi,

 

I suggests you create new module register it on the home hook, and use getProducts function for get products from category

   $categoryObj = new Category($category, $this->context->cookie->id_lang);
   $products = $categoryObj->getProducts($this->context->cookie->id_lang, 0, $limit);

 

Regards

Edited by Alexander Simonchik (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites
  • 1 month later...

Greetings,

 

my apologies for re-opening a closed topic.

 

I'm looking for a way to simply use smarty code to render a product_list from a user defined category ( example: category_id = 7 )

 

Basically, in a custom.tpl file write some initialization code which sets the category id and required inclusions then use this code:

 

{if $products}
  <div class="content_sortPagiBar">
   {include file="$tpl_dir./pagination.tpl"}

  </div>

  {include file="./product-list.tpl" products=$products}

  <div class="content_sortPagiBar">
   {include file="./pagination.tpl"}
  </div>
 {/if}

 

Has anyone done something similar ? or could help me

Share this post


Link to post
Share on other sites
  • 9 months later...

this is how prestashop 1.6 works.

what ps version you use?

 

you just need to pass $products variable to included file, and that's all

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More