VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: EvanGR on November 10, 2021, 10:30:57 AM

Title: Why Order Status code one character only?
Post by: EvanGR on November 10, 2021, 10:30:57 AM
Why is there a limitation for a single character for order status codes?
Is this something that could be improved easily in a future update?

Yes, we are reaching the limit of english alphabet letters, and we could use more order statuses.


Thanks
Title: Re: Why Order Status code one character only?
Post by: Jörgen on November 10, 2021, 11:34:16 AM
You get 10 more statuses by using 0..9. You could probably use more printable characters. But do not use the status 'N' since it will get you in to trouble. It is used internally.

Jörgen @ Kreativ Fotografi
Title: Re: Why Order Status code one character only?
Post by: EvanGR on November 11, 2021, 10:13:37 AM
Thanks, yes we started using numbers already.

I suppose the single-character limit is for legacy compatibility purposes?

Title: Re: Why Order Status code one character only?
Post by: Jörgen on November 11, 2021, 10:25:21 AM
I really do not see why it could not be expanded to more characters. Tests performed seems to be done with string logic. This would probably not be affected by a larger field for order status. But I guess using all available printable characters would more than cover the normal need for order statuses.

Jörgen @ Kreativ Fotografi
Title: Re: Why Order Status code one character only?
Post by: EvanGR on November 11, 2021, 10:34:12 AM
Thanks.

A more advanced use of order statuses, is to use multiple characters and group them into families e.g.

Zxx (e.g. Z00, Z01, Z02)
Bxx
Axx

or even with numbers

2xx
3xx
4xx

Each group (denoted by first char), would signify the broad status (e.g. Completed, Failed, etc)

In our specific case, we use fine-grained Order statuses even to denote stuff like "Waiting to receive from **** supplier". So we are close to using all available single characters.
Title: Re: Why Order Status code one character only?
Post by: Studio 42 on November 12, 2021, 15:04:27 PM
you have 26+10 choice this mean 36 and perhaps some other special char can work to.
How you want handle correctly more then 36 order status  in the list ?
Title: Re: Why Order Status code one character only?
Post by: pinochico on November 12, 2021, 16:42:02 PM
Quotemore then 36 order status  in the list ?

the more stripes, the more addidas  ;D
(said a Vietnamese salesman selling a tracksuit with four stripes)

Maybe - more order status, better shop?
Title: Re: Why Order Status code one character only?
Post by: Studio 42 on November 13, 2021, 12:56:12 PM
Pinochico, i really mean that this order statut Char is stupid, you have an ID for each order statut
But all the system use this char for now.
Title: Re: Why Order Status code one character only?
Post by: EvanGR on November 17, 2021, 08:22:49 AM
@pinochico  ;D ;D ;D

But seriously, we do use that many order statuses because it helps with internal management of orders. Customers only see a few of those statuses. The rest are for internal use.

Also, working with single characters makes it hard to know what a status is about.
Statuses X, F and G
versus
Statuses 201, 207, 405
(assume 2xx are OK, 4xx indicate some sort of problem that requires attention)
Title: Re: Why Order Status code one character only?
Post by: sandomatyas on November 24, 2021, 17:24:24 PM
I agree, extending 1 character to more wouldn't hurt and wouldn't cause backwards incompatiblity
Title: Re: Why Order Status code one character only?
Post by: Milbo on January 12, 2022, 13:20:38 PM
Okey, changed to 3. Should be just 7 places in the install.sql. But it is not in the just uploaded version. EvanGr open your install.sql and change order_status_code to char(3) and all 6 oder_status to char(3). Then use the tableupdater.
Title: Re: Why Order Status code one character only?
Post by: EvanGR on January 12, 2022, 14:41:52 PM
Thank you!