问题
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:
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.
回答2:
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
回答3:
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);
来源:https://stackoverflow.com/questions/1410824/how-to-change-customer-id-and-order-id