Magento - 更改客户ID和订单ID

时间:2009-09-11 13:19:58

标签: php magento sales customer

目前,CustomerID从1开始,而生成的第一个Order具有OrderID:100000001

有没有办法改变这些字段,所以创建的第一个客户有 客户编号:900000001 并创建了第一个订单 订单ID:900000001

3 个答案:

答案 0 :(得分:1)

找到解决方案..

通过更改eav_entity_store表中的increment_last_id,您可以控制客户编号,订单编号,发票编号和发货凭证编号的起始编号。

此致 菲奥娜

答案 1 :(得分:0)

您可以尝试在添加新客户或订单之前更改表格的AUTO_INCREMENT:

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

答案 2 :(得分:0)

将此代码粘贴到 Phpmyadmin 以更改订单号

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

将X替换为所需的订单号

有关详细信息,您可以转到此链接: click here