i just figured out how to sort product by model number.
i searched this forum a whole afternoon, didn't get what i want.
index.php find code:
CODE
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_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
you need to change three places;
1. change $i+1 to $i-1,
2. change 'PRODUCT_LIST_NAME' to 'PRODUCT_LIST_MODEL',
3. change order by pd.products_name to order by p.products_model
so the whole code should be:
CODE
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_MODEL') {
$HTTP_GET_VARS['sort'] = $i-1 . 'a';
$listing_sql .= " order by p.products_model desc";
break;
}
}
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 desc";
break;
}
}
if you only change 2 and 3 place, it won't work on 2 or 3 pages.
If anyone has problem, please just post.

