In some cases shop owners have to change their default order number with a custom prefix or suffix. Customising order numbers sounds complicated, but it can be done with only few MySQL queries.
First, backup your database. After that, get a list of meta_id’s and store_id’s with the following query for order numbers only.
1 |
SELECT * FROM sales_sequence_meta WHERE entity_type = 'order'; |
1 2 3 4 5 6 7 |
+---------+-------------+----------+------------------+ | meta_id | entity_type | store_id | sequence_table | +---------+-------------+----------+------------------+ | 1 | order | 0 | sequence_order_0 | | 5 | order | 1 | sequence_order_1 | +---------+-------------+----------+------------------+ 2 rows in set (0.00 sec) |
The meta_id is pretty much the identifier you need for the next UPDATE query which will add the letter A as a prefix. For example: A100000001
1 |
UPDATE sales_sequence_profile SET prefix = 'A' WHERE meta_id = 1; |
The same query can be used to change the suffix. Also, you can change the prefix or suffix for any entity_type such as invoice, creditmemo or shipment.
That’s it. Create a new order to see the results.