Post by doug3515 » Wed Sep 28, 2011 10:33 pm

Hi there. The default is to do alpha asc. How do I sort price asc by default?

I see in category.tpl the listing for the products. If i did an asort that would only sort the names. Where is the SQL so I can sort appropriately.

Doug

Newbie

Posts

Joined
Tue Sep 27, 2011 9:55 pm

Post by grgr » Thu Sep 29, 2011 3:44 am

Edit ../catalog/controller/product/category.php

Edit line 15 to read:

Code: Select all

			$sort = 'p.price';
Edit ..catalog/model/catalog/product.php

Edit line 127 to read:

Code: Select all

				$sql .= " ORDER BY p.price";	

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by doug3515 » Fri Sep 30, 2011 2:35 am

THANKS!

Newbie

Posts

Joined
Tue Sep 27, 2011 9:55 pm

Post by MatthewB » Fri Oct 07, 2011 5:06 pm

Hi

I can't find the $sql code on line 27?

Matthew


Active Member

Posts

Joined
Sat Jul 23, 2011 5:18 am
Location - Sunderland Tyne and Wear

Post by SXGuy » Fri Oct 07, 2011 5:16 pm

MatthewB wrote:Hi

I can't find the $sql code on line 27?
127.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by MatthewB » Fri Oct 07, 2011 5:17 pm

Sorry meant 127 haha, keyboard slip

Matthew


Active Member

Posts

Joined
Sat Jul 23, 2011 5:18 am
Location - Sunderland Tyne and Wear

Post by grgr » Fri Oct 07, 2011 6:10 pm

MatthewB wrote:Sorry meant 127 haha, keyboard slip
The above is for 1.5.x which is why you probably can't find it.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by MatthewB » Fri Oct 07, 2011 6:35 pm

No worries thanks, i'm running 1.5.1

Matthew


Active Member

Posts

Joined
Sat Jul 23, 2011 5:18 am
Location - Sunderland Tyne and Wear

Post by grgr » Fri Oct 07, 2011 7:21 pm

MatthewB wrote:No worries thanks, i'm running 1.5.1
In which case just do a seach for:

Code: Select all

$sql .= " ORDER BY p.sort_order";
It should be the first occurance and inside this function:

Code: Select all

	public function getProducts($data = array()) {

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by MatthewB » Fri Oct 07, 2011 7:41 pm

Still can't see it,

used ctrl+F and that doesn't find it either.

Matthew


Active Member

Posts

Joined
Sat Jul 23, 2011 5:18 am
Location - Sunderland Tyne and Wear
Who is online

Users browsing this forum: No registered users and 21 guests