Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product order


bflan

Recommended Posts

I am new to os Commerce and would like to know how to display products in the order of my choosing. At the moment they seem to display in alphabetical order.

 

bflan

Link to comment
Share on other sites

You would have to modify following logic in the index.php to change the default order.

 

	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+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
	  break;
	}
  }
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...