Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How list products by Price?


EricK

Recommended Posts

I changed this code in catalog/index.php to list by price.

 

  
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
        $HTTP_GET_VARS['sort'] = $i+1 . 'a';
        $listing_sql .= " order by final_price";
        break;

 

But I need high -> low price as default. Any ideas?

 

Many thanks,

EricK

Link to comment
Share on other sites

Perfect, works great! (and just remove "desc" to sort low --> high)

 

" order by final_price desc "

 

Many thanks to Matti and Matt for your help.

 

Kind regards,

EricK

:)

Link to comment
Share on other sites

  • 2 months later...

Shouldn't it be 'PRODUCT_LIST_PRICE' when wanting to sort by Price:

 

          if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by final_price desc";
         break;

 

 

Your example states 'PRODUCT_LIST_NAME' - just wondering if it may cause a problem somewhere.

 

Thanks,

BD

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...