VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: david.savill on August 25, 2014, 02:03:40 AM

Title: Product Order
Post by: david.savill on August 25, 2014, 02:03:40 AM
Hello,

My Client wants the Products ordered by number (1, 2, 3, 4, etc)

see link: http://www.silksofcheltenham.com/index.php/designer-separates/gerry-weber

However VirtueMart seems to be having trouble understanding that 10, 11, 12, etc comes after 9.... Its ordering them as 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20 21, etc

how do I stop this and get VirtueMart to order them by number correctly?

I'm surprised a complex system like this is struggling...

Thank you
Title: Re: Product Order
Post by: jenkinhill on August 25, 2014, 11:21:59 AM
Simple data issue and not specific to VM. You are storing the number as an alpha-numeric string. It needs to be simply numeric to sort as you require, as it is currently subject to an alpha sort. You could change the field in the products table to numeric with phpMyAdmin but would have to redo that after every VM update.
I guess you could write/commission a plugin to do a numerical sort on the first 2/3 characters of data in the string.

http://dev.mysql.com/doc/refman/5.0/en/data-types.html
Title: Re: Product Order
Post by: david.savill on August 25, 2014, 15:11:57 PM
Hey thanks for your reply,

I've been messing about inside MySQL for ages now and can't seem to find anything which will change it, I've made changes, but nothing is changing on the front end, could you tell me what and where to change? I'm running version 2.6.6 by the way.

I dont mind changing it after every update for this site, I dont think they'll need any updates as they want it to be so basic... Really need this numbering in order for them though.

Seems strange to me that such a hugely used and massively powerful shop creating tool like VirtueMart would have a numbering problem known to computing 10 - 15 years ago.

Is there no PHP or CSS file I can just amend in the override in CPannel to put it straight?
Title: Re: Product Order
Post by: david.savill on August 25, 2014, 16:13:20 PM
Heeeyyyyyy i figured it out :D

thank you very much for your time and response!
Title: Re: Product Order
Post by: johndmarston on September 06, 2014, 02:33:42 AM
What was the solution?