Welcome to WebmasterWorld Guest from 54.234.52.37

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Is there a way to change the numerical order in a drop down menu?

     

danepak

7:14 pm on Aug 26, 2011 (gmt 0)



Hi,
I've created an e-shop selling baby clothing.
I used WP E-Commerce for this and it was pretty simple.
However, there's one small problem.
If someone wants to buy a t-shirt, which comes in the following baby sizes: 000 (which is the smallest size), 00, 0 and 1, then the drop down menu shows it as:
0
00
000
1

That's understandable, as it sees 0 and being smaller than 00.

However, is there a way around this, so the drop down shows
000
00
0
1

lorax

10:19 pm on Aug 26, 2011 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld!
I have loads of issues with that plugin. Very hard to customize. Short answer is I don't have a solution for you. Sorry. :(

Demaestro

10:48 pm on Aug 26, 2011 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I haven't seen the plugin but if you can find the query that selects for that drop-down you can cchange the sort order.

I was playing around with ways to affect the sort order but wasn't able to come up with anything that wasn't ugly.

This is the best I could come up with and it isn't pretty.... BUT it would work.

select *, 1 as slug from product where size_field = '000'
Union
select *, 2 as slug from product where size_field = '00'
Union
select *, 3 as slug from product where size_field = '0'
Union
select *, 4 as slug from product where size_field not in ('0', '00', '000') order by slug, size_field

danepak

3:39 pm on Aug 27, 2011 (gmt 0)



Thanks for both your replies.
Demaestro, I hardly know anything about programming (yet), so not sure how to find the query.