php 如何在 Magento 中更改订单起始编号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9419592/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to Change Order Starting Number in Magento
提问by FlourishDNA
Is there any way to change Order Starting Number in Magento without changing order numbers that are already there? I just want to set 170000xxxx for all new orders.
有什么方法可以在不更改已经存在的订单号的情况下更改 Magento 中的订单起始号?我只想为所有新订单设置 170000xxxx。
Thanks
谢谢
回答by Zachary Schuessler
Look in eav_entity_store
and find increment_last_id
. Update this number, making sure that entity_type_id
is correct for orders.
进去eav_entity_store
找找increment_last_id
。更新此号码,确保entity_type_id
订单正确。
Find the entity_type_id for orders
查找订单的 entity_type_id
SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'order';
SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'order';
回答by Jim OHalloran
The simplest solution for this is to use Ashley Schroder's "Set Custom Order Number"extension. This extension, once installed, makes changing the next order number a simple operation you can do through the back end.
对此最简单的解决方案是使用Ashley Schroder 的“设置自定义订单号”扩展。安装此扩展程序后,您可以通过后端执行更改下一个订单号的简单操作。
Regardless of the method used, make sure your new order number sequence doesn't include existing orders, otherwise bad things happen (unique constraints in the database not satisfied, Magento crashes).
无论使用哪种方法,请确保您的新订单编号序列不包含现有订单,否则会发生不好的事情(数据库中的唯一约束不满足,Magento 崩溃)。
回答by Steve Ross
Sankar had it almost right
桑卡尔几乎是对的
UPDATE `database`.`eav_entity_store` SET `increment_last_id` = '17000000' WHERE `entity_store_id` = 1;
回答by Sankar Subburaj
UPDATE `eav_entity_store` SET `increment_last_id` = '30000000' WHERE `entity_type_id` = STOREID;`
STOREID -> The store id which you are using.
STOREID -> 您正在使用的商店 ID。