Submitted by
guvnor on Mon, 07/26/2010 - 10:13
If you are starting a new web store with prestashop (or any shopping cart for that matter) you do not want the first order you take to be identified as number 1. For some people that makes them look very new and doesn't help inspire confidence in the new shop. If you want to start your orders from a different starting point such as 100 this will tell you how.
You will need to alter your database slightly. This is not as complex as it sounds but it does require some caution. Make a backup of your database before making any changes.
Making changes to a mySQL database can be done in a variety of ways depending on your setup. I will describe how to do it using the command line.
Step 1 Connect to the mySQL database
From the command prompt type:
Please note I have used the username root. You should replace this with whichever username has access to your prestashop database. IF you have forgotten this information you can find this out by checking the _DB_USER setting in the file config\settings.inc.php.
Look for a line that looks a bit this - note the presta_dbuser is the database username.
define('_DB_USER_', 'presta_dbuser');
Step 2 Select the database
Select the database you are using for prestashop. This information can also be got from the config\settings.inc.php file. This time you are looking for an entry like this:
define('_DB_NAME_', 'prestashop_db');
the prestashop_db is the name of the databases.
Once you have this information you can connect to the correct database:
If all has gone well you will receive a response like this
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
Now you are ready to make the change to the table.
Step 3 Change the Orders table starting number
Choose a suitable starting number. In my example I want my first order to start at number 1000.
Note In a default installation the table is called ps_orders. However, you may find your table is called something else.
Now run the following command
ALTER TABLE `ps_orders` AUTO_INCREMENT = 1000;
If all is well you will be greeted with a response like this:
mysql> ALTER TABLE `ps_orders` AUTO_INCREMENT = 1000;
Query OK, 13 rows affected (0.01 sec)
Records: 13 Duplicates: 0 Warnings: 0
And that's it. The next time an order is taken you will see the order number will be 1000.