Magento - Change Customer Id and Order ID

2019-07-20 17:44发布

问题:

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

回答1:

Found a solution to this..

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.

Regards, Fiona



回答2:

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);


回答3:

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