Jump to content

How can I show New Items first in "homefeatured block"??


Recommended Posts

Hello everyone,

I am in v1.3.2.3
How can I show New Items first in homefeatured block??

Since the original "homefeatured block" is set to show the oldest items at the front.
When I add new items on the "Home category",
the "homefeatured block" is also showing the old items.

Therefore, how to make "homefeatured block" shows the new items when I added them??
Thanks for your help.

Link to comment
Share on other sites

You can change the order by in following line

file: /modules/homefeatured/homefeatured.php
function: function hookHome($params)

change following line, to add two more parameters orderBy and orderWay

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



for example, following line, will list product by product id with newest on the top from home category.

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

Link to comment
Share on other sites

  • 1 month later...
You can change the order by in following line

file: /modules/homefeatured/homefeatured.php
function: function hookHome($params)

change following line, to add two more parameters orderBy and orderWay
       $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10));



for example, following line, will list product by product id with newest on the top from home category.

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



Thank you. Its solved with this line.
Link to comment
Share on other sites

×
×
  • Create New...