多个网站共享相同的订单增量 ID 序列?
I noticed this question as asked before but i am not sure how to implement the answer. This is the link.
Magento: Can you set it so all Websites share the same order increment id sequence?
Can you tell me which file to add this to and what line?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本上,您需要添加一个新模块或编辑现有模块并将其添加到您的 config.xml 中,显然要进行更改以匹配您的设置。
您需要将该类添加到 app/code/local/Package/Module/Model/Resource/Mysql4/Setup.php
然后在下创建一个 sql 文件夹
app/code/local/Package/Module/
,然后在 sql 文件夹下创建一个名为 module_setup 的文件夹。所以路径应该是这样的
app/code/local/Package/Module/sql/module_setup
在此文件夹内,您将根据模块的版本号放置安装或升级脚本,例如 mysql4-install-0.1.0.php
这是版本号可以是位于您的 config.xml 中,如下所示
您应该有一个具有以下结构的文件
app/code/local/Package/Module/sql/module_setup/mysql4-install-0.1.0.php
在该文件内,您可以使用以下内容设置文件
然后您可以打开浏览器并点击站点上的任何网址,它应该如果没有更新,您可以通过删除 core_resources 表下 module_setup 的记录器来继续测试。
Basically you need to add a new module or edit one that you have existing and add this to your config.xml, obviously change to match your setup.
You will want to add that class to be located app/code/local/Package/Module/Model/Resource/Mysql4/Setup.php
Then you create a sql folder under
app/code/local/Package/Module/
and then create a folder called module_setup under the sql folder. so the path should look like this
app/code/local/Package/Module/sql/module_setup
Inside of this folder you will put your install or upgrade script based on the version number of your module such as mysql4-install-0.1.0.php
This is version number can be located in your config.xml such as the following
You should then have a file located with the following structure
app/code/local/Package/Module/sql/module_setup/mysql4-install-0.1.0.php
Inside that file you can setup the file with the following
You can then open your browser and hit any url on your site and it should update if not you can keep testing by deleting the recorder for module_setup under the core_resources table.
您可以直接在数据库中更改它。参见表 sales_sequence_meta =>列sequence_table,并将“entity_type”中“order”的引用更改为同一个表,如sequence_order_0。
例如:默认表
meta_identity_typestore_idsequence_table
5order1sequence_order_1
6order2sequence_order_27order3sequence_order_3
8order4sequence_order_4
帮助
更改为
5order1sequence_order_06order2sequence_order_07order3sequence_order_08order4sequence_order_0
。
有
您
这可能对
You can change it directly in the database. See table sales_sequence_meta => column sequence_table and change reference of 'order' in 'entity_type' to same table like sequence_order_0.
Ex: Default Table
meta_id entity_type store_id sequence_table
5 order 1 sequence_order_1
6 order 2 sequence_order_2
7 order 3 sequence_order_3
8 order 4 sequence_order_4
Change To
5 order 1 sequence_order_0
6 order 2 sequence_order_0
7 order 3 sequence_order_0
8 order 4 sequence_order_0
This may help you.