hi, i am an OsCommerce programmer want to know that how to add sort by product price as drop down on product listing page? suggest me in this...
This question keeps coming up & people seem to have trouble finding the answer in the forums, so I'll put this here to make it easy. The product list order is by name as default, that is hard coded within index.php so you must change that to alter. The product list sort order also depends on what was clicked last, you may have noticed that annoying '+' by 'product name' in the list heading, thats supposed to tell you that clicking on that or 'product name' will change list order on product name, similarly clicking on any other heading will order list by that column. The code that sets the default order starts aroun 200 of index.php 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;