开发者

Multiple Websites share the same order increment id sequence?

I noticed this question as asked befor开发者_高级运维e 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


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.

<resources>
<module_setup>
    <setup>
        <module>Package_Module</module>
        <class>Package_Module_Model_Resource_Mysql4_Setup</class>
    </setup>
    <connection>
        <use>core_setup</use>
    </connection>
</module_setup>
</resources>

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

<modules>
<Package_Module>
    <version>0.1.0</version>
</Package_Module>
</modules>

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

$installer = $this;
$installer->startSetup();
$installer->run("
   your code here
");
$installer->endSetup();

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜