Jump to content

Change the order ID structure


szanaszabolcs

Recommended Posts

Hello,

 

I would like to change the deafult PrestaShop order ID structure.

 

The deafult ID sctructure: HZGNXWWXU

 

This is what i want: WEB-2016-00000001

(The last 8 numbert I would like to restart yearly)

 

Which document I need to change and what to do to accomplish find out?

The answers thanks in advance!

Link to comment
Share on other sites

You need to override function generateReference() in classes/order/Order.php

this function return reference generated by Tools class.

 

For example: select from DB last order_id, then increment by 1 and return this as function result.

WEB - prefix, which gets from presences;

2016 - year generated with data('Y');

00001 - reference, generated by func genereteReference();

"-" - separator;

 

it`s simply...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...