Page 1 of 1

Default sort order category page

Posted: Wed Jan 07, 2015 8:41 pm
by lauraderoeck
Hi,

I want the products on my category page to display from new to old by default.
Can someone please tell me how to do this?

Thank you!

Laura

Re: Default sort order category page

Posted: Mon Jan 19, 2015 8:19 pm
by PatrickTT
Hi Laura, I just had to do this myself.

Open /catalog/controller/product/category.php

On or around line 21, change the code from:

Code: Select all

if (isset($this->request->get['sort'])) {
	$sort = $this->request->get['sort'];
} else {
	$sort = 'p.sort';
}
to

Code: Select all

if (isset($this->request->get['sort'])) {
	$sort = $this->request->get['sort'];
} else {
	$sort = 'p.date_added';
}
then on or around line 27, change

Code: Select all

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

Code: Select all

if (isset($this->request->get['order'])) {
	$order = $this->request->get['order'];
} else {
	$order = 'DESC';
}
Hope that helps!

Re: Default sort order category page

Posted: Thu Jun 11, 2015 10:13 pm
by leandromello
I'm trying to do this by quantity.
I want the Out Stock to end of list...

How can i get this?