Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product sort problem


BrotUser

Recommended Posts

Posted

hi folks

 

i've got a big prob over here: my product aren't sorted at all. they should be sorted by name/alphabetically but somehow it doesn't work.

i just wanted to ask here before i install some contribution which might mess up everything way more than it is right now.

 

here's a screenshot (click to enlarge)

778E8.jpg

 

thx for help

Posted

they're sorted by date first then by name if you want to sort them only by name just remove the

p.products_date_added DESC,

 

from catalog\products_new.php file

Posted

the categories have a sort order you could assign, but if you definitely want to sort by name only its the catalog\index.php

 

you will see this

order by sort_order, cd.categories_name

 

change it to this

order by cd.categories_name

Posted

i's sorry for beeing unprecise

what i wanted is the items to order by name in catergory view ;)

not the categories themselves :P (that's at least what it does in my case)

 

do you have another idea?

 

thx in advance!

Posted

i think the problem must be somewhere around here

 

	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 p.products_price";
	  break;
	}
  }
} else {
...

 

when i open a category sort is set to 2a by default ... if i set it to 1a everything's fine

how to set the default to 1a?

Posted

i made a new screeshot with reactived headings to show u whats actually wrong

 

as u see the products should be sorted by product name but they are not.

if i set the sort var to 1a it works as it should

snapzproxscreensnapz0029dr.th.jpg

Posted

ok i finally figured out whats the prob ;)

 

i just had to add

 

	 if (!isset($HTTP_GET_VARS['sort']))  {
 $HTTP_GET_VARS['sort'] = '2a';
 }

 

right in front of the code i posted allready

 

 

big thx again

you helped me alot

Archived

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

×
×
  • Create New...