Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show higher prices first


juanmanuel

Recommended Posts

Posted

Hi! I have a shop with alot of products (aprox 4000) but I need that when someone browse the products by category or manufacturer show the highest prices first.

 

Plase let me know how to set up this. Thank you.

Posted

Look for something like this in your index.php file:

 

        
       case 'PRODUCT_LIST_PRICE':
         $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;

 

Change to :

 

case 'PRODUCT_LIST_WEIGHT':

$listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

case 'PRODUCT_LIST_PRICE':

$listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_price";

break;[/code]

 

This should work for you unless I missed something.

 

Art

Posted

Please disregard the previous post. I think this is more like what you are looking for:

 

Find something like this in your index.php file:

 

 

 

 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 p.products_model";
         break;


Change to:

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 p.products_price";
         break;
       

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...