Magento - Change Customer Id and Order ID

2019-07-20 17:29发布

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

3条回答
\"骚年 ilove
2楼-- · 2019-07-20 17:56

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

查看更多
欢心
3楼-- · 2019-07-20 17:56

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);
查看更多
走好不送
4楼-- · 2019-07-20 18:01

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

查看更多
登录 后发表回答