You are here:  » Changing default search SORT

Support Forum



Changing default search SORT

Submitted by daem0n on Sat, 2009-05-02 09:27 in

Hi David,

Quick question for you. If I'm implementing a change such as:

http://www.pricetapestry.com/node/442

How would I then change the default SORT behaviour to be something else other than ratings. Say, for example I wanted all of my search results to default to ascending prices or something?

Thanks! -Joe

Submitted by support on Sat, 2009-05-02 09:44

Hi Joe,

The default sort order is set by the following code on line 8 of search.php...

  $sort = (isset($_GET["sort"])?$_GET["sort"]:"relevance");

...so if you wanted, for example, price ascending, simply change this to:

  $sort = (isset($_GET["sort"])?$_GET["sort"]:"priceAsc");

(where priceAsc is the key used in the $orderByDefault and $orderByFullText arrays)

Cheers,
David.

Submitted by daem0n on Sat, 2009-05-02 10:02

Great, thanks a lot David!