Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with sort order


dp1726

Recommended Posts

Posted

Trying to figure a way to fix this problem

in my store under products i need to change the order

of my parts small number to larger.

This is what I have now

 

RB-1000-24

RB-2000-24

RB-250-24

RB-3000-24

RB-5000-24

RB-500-24

 

what I would like to get is

 

RB-250-24

RB-500-24

RB-1000-24

RB-2000-24

 

 

I tried to remove the RB-

 

but same problem

 

Any ideas

Thank you

Dave

Posted

where these entries are specified? Under the product's model? or product's name. And wha's the page name/script you need to alter this? There are ways and even contributions to sort the various product fields.

Posted

Now I see, ok this looks like the product's model or some custom field. Ok the why is happening is simple. It will be sorted by the first characters as these are strings not numbers.

 

If you have:

 

10

3

1

2

100

 

Sorting by name will display

 

1

10

100

2

3

 

So either you write a dedicated script to sort certain characters differently (ie sort them as numbers not strings) or you could specify a sort order (using a contribution or something) for the products which is time consuming to administer.

 

Perhaps the easiest will be to setup a script in your osc admin for the categories.php to generate a unique number by combining this catalog digits together for each entry inserted. And then you sort products based on that entry.

Posted

As far as I php script, that's a lot more than I can handle at this point.

I was hoping that there was a numerical way to sort.

If I have to I can change from RB-250

to 250-RB-24.

 

I try a search in Contributions.

Thank You for the help.

Dave

Posted
As far as I php script, that's a lot more than I can handle at this point.

I was hoping that there was a numerical way to sort.

If I have to I can change from RB-250

to 250-RB-24.

 

I try a search in Contributions.

Thank You for the help.

Dave

 

No matter how you order the characters won't help you because these are treated like strings not numbers, as I mentioned.

Archived

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

×
×
  • Create New...