This module is the beginning of an attempt at getting order number prefixes implemented for Ubercart.
This is what it does:
- Adds a field in Order Settings where you can specify a prefix to be used for order numbers.
- Adds a order_id_prefixed property to the Ubercart order object containing the prefix + the order_id.
- Adds 3 new tokens:
- order-id-prefixed: The order ID with prefix applied.
- order-link-prefixed: A link to the order using the prefixed order ID.
- order-admin-link-prefixed: A link to the order admin view page using the order ID.
The order_id_prefixed property can be referenced by other modules and the tokens can be included in invoice templates and checkout messages.
What is doesn't do:
It doesn't modify any of the Ubercart order lists. It doesn't modify the order_id displayed when viewing or editing orders. As far as I can see, none of this can be done without modifying the uc_orders module. It doesn't store the prefixed order number anywhere in the DB. This can be done easy enough, but it seems silly to have a completely separate table just for that. Ideally I'd like to see the uc_orders module add a "alternate_key" field to the orders table. It doesn't have to put anything in there by default, but if there was a alternate_key property of the order object other modules could set it as they see fit and the uc_orders could save and load it with the rest of the order.
I hope this will at least spur some discussion and maybe we can get some changes made to core to support this kind of functionality. I would be happy to submit a patch, but I don't want to do the work and then have it be ignored.