hmmm this is confusing!
lets recap:
i've attached my:
Catalogue.ss template
Product.php class for the dataobject
Catalogue.php class for the page
this is the code that limits the results and SHOULD sort them into DEC by displayOrder (which are numbers from 1- 715)
class Catalogue extends Page {
public function ProductList ($filter = null){
if(!isset($_REQUEST['start'])) $_REQUEST['start'] = 0;
$limit = $_REQUEST['start'].",25";
$order = 'DisplayOrder DESC';
return DataObject::get('Product', $filter, $order, null, $limit);
}
but it doesn't...there is SOME order to it:
http://www.worldaircraftsolutions.com.sg/catalogue/?flush=1&start=0
but its not right!
it looks like it is only sorting the current page. so 25 results at a time. every page is sorted by displayOrder but not the whole catalogue... so i guess the problem lies in my $limit?
EDIT:
just took ut the limit and the sort order is fine... so its limiting the results before sorting them into order i guess?
any ideas?
UPDATE:
i took out this line: $ProductList.sort(DisplayOrder)
from my template and the order stopped working completely! so this line of code in my php file: $order = 'DisplayOrder DESC'; wasnt working.
i took out the word DESC and now it orders the items...but only by first character, not the whole number!
can anybody help with this?!?