Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Sort By Price


Paradisebg

Recommended Posts

I want in index.php and advanced_search_result.php products sort by Price not by name.

I Replace this above line

$listing_sql .= " order by pd.products_name";

 

With this line

$listing_sql .= " order by final_price";

 

But this work only on firs page when I click on second page products sort by name.

Link to comment
Share on other sites

I want in index.php and advanced_search_result.php products sort by Price not by name.

I Replace this above line

$listing_sql .= " order by pd.products_name";

 

With this line

$listing_sql .= " order by final_price";

 

But this work only on firs page when I click on second page products sort by name.

 

try changing the line above $listing_sql .= " order by pd.products_name";

 

from

 

$HTTP_GET_VARS['sort'] = $i+1 . 'a';

 

to

 

$HTTP_GET_VARS['sort'] = $i . 'a';

Link to comment
Share on other sites

try changing the line above $listing_sql .= " order by pd.products_name";

 

from

 

$HTTP_GET_VARS['sort'] = $i+1 . 'a';

 

to

 

$HTTP_GET_VARS['sort'] = $i . 'a';

 

   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 . 'a';
	   $listing_sql .= " order by final_price";
	 break;

not work only in first page products sort by price on second sort by name

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...