Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Changing the ordernumber in Magento  (Read 3947 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Changing the ordernumber in Magento
« on: August 30, 2014, 02:20:51 pm »
When moving to Magento, some people might want to change the default ordernumber 000000001 to some other number - either fooling the customer into thinking this is a very popular shop, or when migrating from another webshop to Magento. Here's how to change that order number.

MySQL table eav_entity_store

New ordernumbers are determined by a value called the increment_id, and this increment_id is stored in the database table eav_entity_store. You should login to the MySQL database using a program like phpMyAdmin, and then you will be able to edit the contents of this table.

If the database table is empty, this means that the system has not created any orders yet. Instead of trying to hack the database, it's best to create a fake order. To create a fake order you will also need to create a customer and a product, so it's probably best to perform this task just before you're going live with your shop.

Changing which increment_id?


Once you have completed orders, the table eav_entity_store will contain various records, and every record contains a different increment_id. The logic here is that increment_ids are used by various Magento entities, like orders and customers. In a default situation the record for customers has an entity_type_id of 2, while orders have an entity_type_id of 11. So to change the ordernumber for orders, you will need to edit the row with entity_type_id 11.

If you really want to know the IDs used for the different entities in the Magento database, take a look in the database table eav_entity_type, which lists various parts of an entity (like underlying PHP-classes and other MySQL tables).

What can you do with the ordernumber?

We recommend not changing the length of the ordernumber, nor the starting number of the increment_id (which should be the same as the increment_prefix) in the same table. But you can easily change some of the zeroes into other numbers.

 :) :) :) :)