Alphanumerical sorting missed, pls help

Hello everybody! I’m running CS-Cart Pro edition, latest version and I’m having some troubles with sorting. There are a lot of products, like models, which name has numbers in it. For example BEG 600, BEG 700, BEG 1100, BEG 1800 etc. So by default sorting (by name) it’s sorted this way:



BEG 1100

BEG 1800

BEG 600

BEG 700



So it’s sorting only by first number, but for visitor it looks strange. And I’m in trouble how to fix this thing. I can’t sort by date, or by article. Either I can’t do it manually because I’ve so much products. I’m looking for fix. Something like natsort function in .php. If anyone has any ideas about it, or know solution - please let me know, it will be so helpful… Thank you!..

Have a look at this post: [url]http://forum.cs-cart.com/showthread.php?t=14820&highlight=product+sort[/url]



John

[quote name=‘JohnCarroll’]Have a look at this post: [url]http://forum.cs-cart.com/showthread.php?t=14820&highlight=product+sort[/url]



John[/QUOTE]



Thank you for ur reply John. I’ve seen this topic too. But I don’t really need to create a new my own style of sorting. I’m happy with Sorting by Name, but I need to fix for correct number sorting after letter name. If u got products called for example:



Alpha 300, Alpha 600, Alpha 1100, Alpha 1800 and Beta 300, Beta 600, Beta 1100, Beta 1800 and etc. in default sorting by name it will looks like:



Alpha 1100

Alpha 1800

Alpha 300

Alpha 600

Beta 1100

Beta 1800

Beta 300

Beta 600

etc.



But I need it looks like:



Alpha 300

Alpha 600

Alpha 1100

Alpha 1800

Beta 300

Beta 600

Beta 1100

Beta 1800



etc.



I mean Sorting by name is sensitive to a first letter like A,B,C etc. (it’s ok) and to a first number. And it doesn’t care that 100 and 1000 it’s two different values. And that thing I’d love to fix… :confused:

Thank you for ur reply John. I’ve seen this topic too. But I don’t really need to create a new my own style of sorting. I’m happy with Sorting by Name, but I need to fix for correct number sorting after letter name. If u got products called for example:



Alpha 300, Alpha 600, Alpha 1100, Alpha 1800 and Beta 300, Beta 600, Beta 1100, Beta 1800 and etc. in default sorting by name it will looks like:



Alpha 1100

Alpha 1800

Alpha 300

Alpha 600

Beta 1100

Beta 1800

Beta 300

Beta 600

etc.



But I need it looks like:



Alpha 300

Alpha 600

Alpha 1100

Alpha 1800

Beta 300

Beta 600

Beta 1100

Beta 1800



etc.



I mean Sorting by name is sensitive to a first letter like A,B,C etc. (it’s ok) and to a first number. And it doesn’t care that 100 and 1000 it’s two different values. And that thing I’d love to fix… :confused:

Anyone please?..

You would need to implement some kind of special sorting. Your request is very non-standard. You are wanting to treat each word like it’s a separate field.

[quote name=‘tbirnseth’]You would need to implement some kind of special sorting. Your request is very non-standard. You are wanting to treat each word like it’s a separate field.[/QUOTE]



Mmm… But what if I create product simply with a name:



300

400

500

800

1000

2000

with no additional symbols, in default “by name” sorting it will looks like



1000

2000

300

400

500

800



but 1000 and 2000 must be last one because thousand > then hundred… I need simply to make it understand it. There is similar in .php called sort and natsort. The difference that “sort” sort only by first number and “natsort” sort by full number.

Then you could change the sorting type to numeric rather than alpha.

[quote name=‘tbirnseth’]Then you could change the sorting type to numeric rather than alpha.[/QUOTE]



Thank you for your advices, but I need to sort Alpabetic and Numeric in one time. It’s sorting like this now too: If u will name product a 1, a 2, a 3. The will be sorted correctly like^



a 1

a 2

a 3



but if u will add “a 20” it will be



a 1

a 20

a 2

a 3



That is kinda stupid… Because “a 20” must be after “a 3”