Magento – Magento 2 – sales-order-increment-prefix is not working

magento2sales-order

I want to add a prefix to sales order id. I install magento using "–sales-order-increment-prefix" as below:

php bin/magento setup:install --base-url=http://local.magento.com/ \
--db-host=127.0.0.1 --db-name=db1 --db-user=root --db-password=123456 \
--admin-firstname=Admin --admin-lastname=Admin --admin-email=abc@gmail.com \
--admin-user=admin --admin-password=1qaz2wsx --language=en_US \
--currency=HKD --timezone=Asia/Hong_Kong --use-rewrites=1 --backend-frontname=admin \
--sales-order-increment-prefix=abc

However, it is not working. And it results that the invoice id is always duplicated at PayPal side. Can anyone help?

Note: My Magento version is 2.0.8.

Best Answer

I had the same issue. Modifying the sales_sequence_profile table worked for me in Magento 2.1.1.

#mysql - I'm changing prefix for everything here - add where condition if you only want to update order prefix
update sales_sequence_profile set prefix = 6

# Magento command line
bin/magento cache:flush
bin/magento indexer:reindex
Related Topic