spooks, on Oct 9 2008, 10:04 AM, said:
I just reliased why, perhaps I should have realised before but I`ve got lots on right now so cant think of everything.
I bet you havent included products quantity in the column list, that means the line:
if ($column_list[$i] == 'PRODUCT_LIST_QUANTITY') {
will always fail, so
$listing_sql .= " order by p.products_quantity";
never gets added
so instead of:
if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_QUANTITY') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by p.products_quantity";
break;
}
}
} else {
put: if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
$HTTP_GET_VARS['sort'] = 0 . 'a';
$listing_sql .= " order by p.products_quantity";
} else {Hi Sam,
I was having a similar problem to what WoodsWalker was describing. I decided to add four characters to the beginning of each product's model number. The first was a letter to signify the general category of the item, the second and third were the sorting number, and the forth was a hyphen, to separate it from the rest of the model number, for example: A04-######## would be the forth item in the Accessories category. This seems to work great, except for a few products that wouldn't sort in the right order.
So, finding your post, I tried removing the "if ($column_list[$i] ==..." code. Everything sorted fine, then, but my formating vanished. Suddenly, my background wasn't there, much (if not all) of the text formating was gone. Any clues?
For full details:
Old Code:
Quote
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_MODEL') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by p.products_model";
break;
}
}
} else {
New Code:
Quote
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by p.products_model";
} else {
Thanks!
Edited by Snowy_River, 30 November 2008, 19:24.














