【问题标题】:How to Change Order Starting Number in Magento如何在 Magento 中更改订单起始编号
【发布时间】:2012-02-23 19:11:07
【问题描述】:

有没有办法在 Magento 中更改订单起始编号而不更改已经存在的订单编号?我只想为所有新订单设置 170000xxxx。

谢谢

【问题讨论】:

标签: php mysql magento e-commerce


【解决方案1】:

查看eav_entity_store 并找到increment_last_id。更新此号码,确保 entity_type_id 对订单正确。

查找订单的 entity_type_id

SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'order';

【讨论】:

  • 我猜订单的实体类型 ID 总是 4,或者至少应该将最后一个订单号与 increment_last_id 中的值匹配。
  • 我安装的“订单”的 entity_type_id 似乎总是 5。我会使用上面给出的查询来始终检查给定安装的正确 ID。
【解决方案2】:

Sankar 几乎是对的

UPDATE `database`.`eav_entity_store` SET `increment_last_id` = '17000000' WHERE `entity_store_id` = 1;

【讨论】:

  • 不。他弄错了,建议它是商店 ID。它应该是订单实体 ID。请参阅对 Sankar 答案的第一条评论。
【解决方案3】:

最简单的解决方案是使用Ashley Schroder's "Set Custom Order Number" 扩展。此扩展程序一旦安装,就可以使更改下一个订单号成为您可以通过后端进行的简单操作。

无论使用哪种方法,请确保您的新订单编号序列不包含现有订单,否则会发生坏事(不满足数据库中的唯一约束,Magento 崩溃)。

【讨论】:

【解决方案4】:
UPDATE `eav_entity_store` SET `increment_last_id` = '30000000' WHERE `entity_type_id` = STOREID;`

STOREID -> 您正在使用的商店 ID。

【讨论】:

  • 这是不正确的。您将 entity_type_id 和 store_id 混为一谈。我相信您的意思是:UPDATE eav_entity_store SET increment_last_id = '30000000' WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'order');
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-05-23
  • 1970-01-01
  • 2011-08-14
  • 2014-06-16
  • 1970-01-01
  • 1970-01-01
  • 2015-10-20
相关资源
最近更新 更多