Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product listing woes


chowpay

Recommended Posts

Posted

Hi ,

 

Currently the oScom sites I?ve been working on have automatically been sorting the product listing alphabetically. Is there a way to sort it by model number (lowest first highest last?).. which php file do I need to edit to make this change?

 

Not sure how to do this? Thanks to for looking and if you can help even bigger thanks!

Posted
try this:

 

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

 

Version 1.1c added a model number into the product listing.

 

 

Thanks, but it seems like the customer has to click to choose to sort.. I kind of want the shop to default display by model number rather than by alphabetical product name.

 

I'll check this out though.. You wouldnt happen to know which php file intiates the product listing sort? or what I would need to change on that code to make it sort by model number?

 

Thanks!

Posted
Thanks, but it seems like the customer has to click to choose to sort.. I kind of want the shop to default display by model number rather than by alphabetical product name.

 

I'll check this out though.. You wouldnt happen to know which php file intiates the product listing sort? or what I would need to change on that code to make it sort by model number?

 

Thanks!

 

 

bumpidy bump bumb...

Posted

you change the catalog\index.php

 

from this

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

 

to this:

	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_MODEL') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by p.products_model";
	  break;
	}
  }
} else {

Archived

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

×
×
  • Create New...