Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Produts sort by price


sagitario

Recommended Posts

you could change it from the catalog\index.php

 

instead of

	  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;
	}
  }

 

use this

 

	  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {
	   $listing_sql .= " order by p.products_price";
	  break;
	}
  }

Link to comment
Share on other sites

Thank enigma1 for the help. :thumbsup:

 

I try another way.

 

	  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by p.products_price";
	  break;
	}
  }

 

This way the prices are sort by price and you can sort by name our something else. :D

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...