Magento Themes and Magento Extensions

Magento : how to set the same order increment id for all stores

Share

Magento in default sets different order increment id for each of you magento store or store views.
Here is simple fix to set the same order increment id for all your store.
Run the following code once from anywhere within your site.

Mage::getModel(‘eav/entity_type’)
->loadByCode(‘order’)
->setIncrementPerStore(false)
->save();

For eg.paste it in any catalog/product/list.phtml template file. Then open up the category listing page in the browser to run the code.
Once done, you can remove the code from list.phtml.
Now if you place new orders from any store, all of them will follow the same order increment id.
Moreover if you want to set the initial starting increment id like 200000001
open up your magento site database and goto table named “eav_entity_store”

Find the row which has value of store_id = 0,
edit the row and set increment_prefix to the initial prefix that you want your order number to have for eg.2
and on the “increment_last_id” field, enter the new increment id that you want your new orders to start from.

Comments are closed.