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

Posted on Updated on

Hello Magento people,

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.

Thank you for reading..

Advertisements

5 thoughts on “Magento : how to set the same order increment id for all stores

    david said:
    May 22, 2012 at 7:30 PM

    Hi, Thank you for this.
    How would you do the same for shipment notification numbers?

    david said:
    May 23, 2012 at 2:27 PM

    I placed your code in the header and it didnt work.

    david said:
    May 23, 2012 at 10:14 PM

    HERE IS THE SOLUTION THAT WORKED FOR ME ON VER. 1.6.2.0 http://www.magentocommerce.com/boards/viewreply/154594
    ENJOY

    pipala said:
    July 17, 2013 at 3:16 PM

    Thank you very much !

    I put it in an sql upgrade of my Sales module and it works fine 😉

    Steven said:
    August 8, 2013 at 3:14 PM

    Hi! This solution is also good and worked for me – http://amasty.com/custom-order-number.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s