Jump to content

[Solved] Order by name the products in "Home featured products" module?


Recommended Posts

Change line 69 of modules/homefeatured/homefeatured.php (in PrestaShop v1.3.1) from:

$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10));



to:

$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'name', 'ASC');

  • Like 2
Link to comment
Share on other sites

One of the best things of Prestashop is this amazing forum!! and his moderator!!!!!!
I agree.

@rocky : what if I want the featured product list to sort by Recently Added Products? (not the Home New Products Module)
thanks
Link to comment
Share on other sites

Then change the line above to:

$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC');



This will display the most recently added product first.

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

Change line 69 of modules/homefeatured/homefeatured.php (in PrestaShop v1.3.1) from:<br/><br/>

<br/>$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10));<br/>

<br/><br/>to:<br/><br/>

<br/>$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'name', 'ASC');<br/>

 

Hi rocky, is it possible to select featured products randomly? thanks

Link to comment
Share on other sites

  • 11 months later...

Hi,

i have this module (Home featured products) installed into my site.

How can order products by "position" ?

I have configurered products preferences in order to display "position inside category" but does not work.

 

Edition of Products position work fine as I saw at database (ps_category_product table) but homepage does not show the proper products order.

 

Thanks in advanced

Juan

Link to comment
Share on other sites

×
×
  • Create New...