Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to sort by Price


H20hum

Recommended Posts

Hi Im looking to be able to sort Products by price. On all the pages the products are currently sorted by the order they are entered. I would like to try and get every page to be sorted by price. I have had a few suggestions but they havent worked so far. :blink:

 

Any help on this subject would be great.

 

Craig :thumbsup:

Link to comment
Share on other sites

Thanks for the help,

Sorry for the delay in replying. Tried your contribution...still no luck. Ive been told to change that peice of code before. Im really not sure why I cant get it to work :(

 

Thanks anyway!

 

Craig :blink:

Link to comment
Share on other sites

Thanks for the help,

Sorry for the delay in replying. Tried your contribution...still no luck. Ive been told to change that peice of code before. Im really not sure why I cant get it to work :(

 

Thanks anyway!

 

Craig :blink:

Link to comment
Share on other sites

Posted this already but just in case someone needs it...

 

Following the help from above, I was able to get the sorting by price corrected. The only thing is I had to actually close my storefront browser and open a new browser. The sorting wouldn't correct itself by just reloading the page. I also made some other changes too tho.

 

My new code looks like this:

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

Link to comment
Share on other sites

  • 2 weeks later...
Posted this already but just in case someone needs it...

 

Following the help from above, I was able to get the sorting by price corrected. The only thing is I had to actually close my storefront browser and open a new browser. The sorting wouldn't correct itself by just reloading the page. I also made some other changes too tho.

 

My new code looks like this:

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

 

When I used this:

http://www.oscommerce.com/community/contributions,4235

 

It would sort page 1, but not any of the other pages.

 

nomadx change worked and it sorts all pages by price now.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...