Author Topic: Why Order Status code one character only?  (Read 1953 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 491
Why Order Status code one character only?
« 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

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3911
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Why Order Status code one character only?
« Reply #1 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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

EvanGR

  • Jr. Member
  • **
  • Posts: 491
Re: Why Order Status code one character only?
« Reply #2 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?


Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3911
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Why Order Status code one character only?
« Reply #3 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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

EvanGR

  • Jr. Member
  • **
  • Posts: 491
Re: Why Order Status code one character only?
« Reply #4 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.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4663
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Why Order Status code one character only?
« Reply #5 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 ?

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1599
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Why Order Status code one character only?
« Reply #6 on: November 12, 2021, 16:42:02 pm »
Quote
more 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?
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4663
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Why Order Status code one character only?
« Reply #7 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.

EvanGR

  • Jr. Member
  • **
  • Posts: 491
Re: Why Order Status code one character only?
« Reply #8 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)

sandomatyas

  • Jr. Member
  • **
  • Posts: 376
Re: Why Order Status code one character only?
« Reply #9 on: November 24, 2021, 17:24:24 pm »
I agree, extending 1 character to more wouldn't hurt and wouldn't cause backwards incompatiblity

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10451
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Why Order Status code one character only?
« Reply #10 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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

EvanGR

  • Jr. Member
  • **
  • Posts: 491
Re: Why Order Status code one character only?
« Reply #11 on: January 12, 2022, 14:41:52 pm »
Thank you!