Odd Price Ordering Behaviour
11 posts by 4 authors in: Forums > CMS Builder
Last Post: June 29, 2010 (RSS)
By Jason - June 29, 2010
Hi,
If you want to default to sorting by title if a price link hasn't been clicked, you can change the code to this:
As for the issue with the ? or 0's, what I would suggest is to get two sets of records, one with everything sorted by price, and the second with all the records that don't have any price information. You can then output these records at the very end.
Hope this helps.
If you want to default to sorting by title if a price link hasn't been clicked, you can change the code to this:
if(@$_REQUEST['order_by'){
$order=@$_REQUEST['orderBy'];
if($order=="land_line_cheap_price" || $order=="land_line_cheap_price DESC"){
$order = str_replace("land_line_cheap_price","land_line_cheap_price+0",$order);
}
else{
$order = str_replace("land_line_price","land_line_price+0",$order);
}
}
else{
$order="title";
}
list($isp_listRecords, $isp_listMetaData) = getRecords(array(
'tableName' => 'isp_list',
'perPage' => '15',
'where' => " category LIKE '%Fixed Line Broadband%' ",
'orderBy => "$order",
'loadCreatedBy' => false,
));
As for the issue with the ? or 0's, what I would suggest is to get two sets of records, one with everything sorted by price, and the second with all the records that don't have any price information. You can then output these records at the very end.
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/