News Flash:
New Version of ShopClass theme 1.4.0 is Released on 13 JUNE 2018, Please upgrade your installation.

Custom Query for search

Use this forum to get general help about the issues of osclass.A place to talk about anything related to Osclass in general. This is not the place to ask support questions.
Post Reply
nileshjainmac
Beginner
Posts: 19
Joined: Tue Aug 26, 2014 10:48 am

Custom Query for search

Post by nileshjainmac » Tue Apr 07, 2015 6:59 am

Dear Sir,

We want to implement custom query for search the listing. By default it shows data from publishing date, how can we display display data from the highest price, so default it shows highest price listing on top.

thanks in advance.

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: Custom Query for search

Post by tuffadmin » Thu Apr 09, 2015 7:49 am

You need to add this code in you custom-functions.php file

################Custom function to change Order type at search page###########
function tfc_search_price_first(){
if (!($params['iOrderType'])){
Params::setParam('iOrderType', 'desc');}
if (!($params['sOrder'])){
Params::setParam('sOrder', 'i_price');}
}
osc_add_hook('before_search','tfc_search_price_first');
###############Custom Function End #######################################
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

Post Reply