Monday 4 July 2022

How to add custom value prefix in order and invoice number. in magento 2

 How to add custom value prefix in order and invoice number.


I like to add prefix in order and invoice number and next number should be in current year and last 4 digit is Increment number, this are all without extension.


Example: 0001 to aa-yy0001



sales_sequence_profile:



For invoice: 

UPDATE sales_sequence_profile SET prefix = 'aa-yy' WHERE meta_id = 6;


For order: 

UPDATE sales_sequence_profile SET prefix = 'Pic_' WHERE meta_id = 5;