Fiona
Fiona

Reputation:

How to change Customer Id and Order ID?

Currently CustomerID's start at 1 while the first Order generated has OrderID 100000001.

Is there any way of altering these fields, so the first customer created has customer number 900000001 and the first order created has OrderID 900000001?

Upvotes: 2

Views: 6800

Answers (3)

soshial
soshial

Reputation: 6808

You may try to alter the AUTO_INCREMENT of the table before adding new customer or order:

$magento_db = Mage::getSingleton('core/resource')->getConnection('core_write');
$magento_db->query("ALTER TABLE customer_entity AUTO_INCREMENT = ".$desiredId);

Upvotes: 0

Fiona
Fiona

Reputation:

By changing the increment_last_id in eav_entity_store table, you can control the starting number of customer number, Order Number, Invoice Number, and shipping Memo Id.

Upvotes: 1

Justin
Justin

Reputation: 21

Paste this code to Phpmyadmin to change the Order Number

UPDATE eav_entity_store
INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id
SET eav_entity_store.increment_last_id='XXXXX'
WHERE eav_entity_type.entity_type_code='order';

Replace the X‘s with your desired order number

for more detail you can go to this link for that: click here

Upvotes: 0

Related Questions