Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Sort Products By Price


2 replies to this topic

#1 Rochdalemark

  • Community Member
  • 468 posts
  • Real Name:Fred Doherty
  • Gender:Male
  • Location:Rochdale U.K

Posted 27 February 2006, 16:12

I have my products listed in colums, and at the moment they are listed by product name. ie:-

125Kg Traditional Sack Truck | 150Kg Folding Toe Sack Truck
150Kg Solid Toe Sack Truck | 200Kg Folding Toe Sack Truck

etc

But when I go into index.php and change the following:-

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

To

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

My listings get messed up. It's fine on the first page but as soon as you click through the pages 1,2,3 etc the same items keep cropping up on different pages as though there listed at random.

Can anyone help with this? I'd really like to keep everything ordered by price.

Thanks in advance for any help.

#2 enigma1

  • Community Member
  • 8,206 posts
  • Real Name:Mark Samios

Posted 27 February 2006, 17:34

change also the

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

to

if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {

#3 Rochdalemark

  • Community Member
  • 468 posts
  • Real Name:Fred Doherty
  • Gender:Male
  • Location:Rochdale U.K

Posted 27 February 2006, 17:53

View Postenigma1, on Feb 27 2006, 05:34 PM, said:

change also the

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

to

if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {

Cheers enigma1,


That worked a treat,, it's always the simple things I miss :)