Post by skip » Tue Dec 20, 2011 6:04 am

how to change this in version 1.5.0.5
when open category default sorting is not "default" than "price(low>high)"

thanx

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by OpenCart Addons » Tue Dec 20, 2011 11:23 pm

If you're looking to change the default category page sort to be done by price, try this:

In catalog / controller / product / category.php

Find:

Code: Select all

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

Code: Select all

if (isset($this->request->get['sort'])) {
			$sort = $this->request->get['sort'];
		} else {
			$sort = 'p.price';
		}
This won't change the wording from default to "Price (Low>High)" though.

Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by skip » Thu Dec 22, 2011 5:51 am

Thank you very much. Works perfect.

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by woogygun » Thu Feb 28, 2013 1:20 pm

Ive got grid view set by default, is there a way to display the products still in grid view, but priced from low to high?

Newbie

Posts

Joined
Wed Oct 10, 2012 2:26 am

Post by craigwhituk » Wed Oct 30, 2013 11:16 pm

Can this be set from high to low and if so what needs to be added?

Thanks

Newbie

Posts

Joined
Wed Oct 30, 2013 11:15 pm

Post by DonDon » Sat Aug 01, 2015 5:50 am

If anyone still cares you can change the price sorting from Low to High, to High to Low.

go to Catalog / Controller / product / category.php

On mine it is Line 24 to line 28. Replace this:

Code: Select all

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

Code: Select all

if (isset($this->request->get['order'])) {
			$order = $this->request->get['order'];
		} else {
			$order = 'DESC';
		}
tested and works perfectly on version 1.5.5.1 Hope this helps!

Newbie

Posts

Joined
Mon Mar 23, 2015 3:03 pm
Who is online

Users browsing this forum: No registered users and 4 guests