How to change Customer Id and Order ID?

泪湿孤枕 提交于 2019-12-11 04:09:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!