Page 1 of 1

Sort all products by "Most Recent" like "Latest Products"

Posted: Fri Mar 23, 2012 5:21 pm
by akgamerx
Is there a simple way to make all products within the category pages display as most recently first? The same way most recent products are displayed first within the "latest products" module?

Thank you.

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Fri Mar 23, 2012 5:50 pm
by inspirio
THIS "HACK" WILL BE CHANGE THE DEFAULT LOOK IN YOUR CATEGORY LIKE LOOK (like you click on sort by: button) :P

Search this in:

catalog\controller\product\category.tpl

if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.sort_order'; <--- change to: p.model !!!!!!!!!!!
}

if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC'; <--- change to DESC !!!!!!!!!!!!!!!
}


If you want try with another option :
p.sort_order-ASC = default sort
pd.name ASC">Name (A - Z)
pd.name DESC">Name (Z - A)
p.price ASC">Price (Low > High)
p.price DESC">Price (High > Low)
rating DESC">Rating (Highest)
rating ASC">Rating (Lowest)
p.model ASC">Model (A - Z)
p.model DESC">Model (Z - A)

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Sat Mar 24, 2012 4:42 am
by akgamerx
Thank you very much for your reply but this doesn't quite get me the results I'm looking for.

There is no way to make all products appear the same way "latest products" do? Newest to Oldest.

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Sat Mar 24, 2012 4:59 am
by akgamerx
Never mind, I feel quite silly. I just did "p.date_added" and "DESC" the same as shown in the latest products module. Very easy =]

For anyone else who wants their products to show in order by the date added the same as the latest product module it's simply this:

catalog/controller/product/category.php

if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.date_added'; <--- (Change from p.sort_order)
}

if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'DESC'; <--- (Change from ASC)
}

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Sat Mar 24, 2012 5:09 am
by inspirio
You did the same that i told you :) Respect man :)

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Thu Jun 28, 2012 10:34 am
by debcampos
Thank you !

I did exactly what you did and it worked. Also i went a step further and changed the language in the file:
/catalog/language/english/product/category.php

From " Default" to "Latest Added" ;D

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Tue Jul 24, 2012 5:05 pm
by DJM
Here's a vQmod, tested in version 1.5.1.3, which will change the default sort order to show most recent items first on category and manufacturer pages.

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Thu Aug 16, 2012 4:48 am
by jimmyharwood
DJM wrote:Here's a vQmod, tested in version 1.5.1.3, which will change the default sort order to show most recent items first on category and manufacturer pages.
You are the man, this has been driving mad for ages, many thanks

Jimmy

Re: Sort all products by "Most Recent" like "Latest Products

Posted: Fri Aug 17, 2012 6:04 am
by adzeds
Awesome work. Have added to my site!

Re: Sort all products by "Most Recent" like "Latest Products"

Posted: Wed Nov 01, 2017 8:21 pm
by rikmg67
works even on 2.3.2 :)