Jump to content

[SOLVED] Homefeatured: Sorting ASC not DESC


Recommended Posts

Hi,
I have searched the forums and not found anyone with this problem. The closest that I can get is people having trouble with the sorting of new products.

My HomeFeatured module is listing the products in order of their product ID (or the order they were added to the database, not sure which as they work out to the same thing). This is a problem for me as I have the number to display set to 16 and I have more than 16 items in my Home category so there are two things wrong.. the first is that the oldest items are displayed first, and the newest items are not displayed at all.

Is there some simple way to change the sorting to "newest first"?

Thanks
John

Link to comment
Share on other sites

Ok, Sortof fixed already..
I changed the homefeatured.php line

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


to be

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


which does exactly what I want..
My question now is whether there is any way that could be made the default mode as it used to be in previous versions of PS? Either that, or add the sort option as a param in the HomeFeatured module?

John

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...