News:

Looking for documentation? Take a look on our wiki

Main Menu

Product Order

Started by david.savill, August 25, 2014, 02:03:40 AM

Previous topic - Next topic

david.savill

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

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

david.savill

#2
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?

david.savill

Heeeyyyyyy i figured it out :D

thank you very much for your time and response!

johndmarston