Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Set different order increment_id starting number
 
Andy LD
Jr. Member
 
Total Posts:  21
Joined:  2008-06-26
 

Dear Forum Members!

Is it possible to set the order id number to a different starting number other than 100000000? What I would like to have is a starting number like 152952758, because then it is not possible to tell how many orders have already been placed in the shop.
I already tried to manually set the increment_id of the last order to a different number, in multiple tables, but this does not change the next coming order id.

Any comments or suggestions would be very appreciated.

Regards,
Andy

 
Magento Community Magento Community
Magento Community
Magento Community
 
Very Clever Stuff
Sr. Member
 
Avatar
Total Posts:  90
Joined:  2008-05-06
Sheffield, UK
 

ALTER TABLE table_name AUTO_INCREMENT = 152952758;

 
Magento Community Magento Community
Magento Community
Magento Community
 
super tonio
Member
 
Total Posts:  57
Joined:  2008-04-10
 

Thanks Dave, that works, but which table should that happen to? If you do it on sales_order it changes the `entity_id` rather than `increment_id` which is the Order ID#. We actually started with the standard 10000001 but now want to go to a “random” larger number so it’s not so obvious to customers how many orders have been made.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
detrate
Jr. Member
 
Total Posts:  3
Joined:  2008-10-22
 

UPDATE `eav_entity_storeSET `increment_last_id` = '152952758' ;
 
Magento Community Magento Community
Magento Community
Magento Community
 
long2k9
Jr. Member
 
Total Posts:  10
Joined:  2009-02-24
 

Hi,

I’m not programming guru here. Please help me with this same problem. Where could I find the codes, or MySQL table, or php to change the default Order ID 1000000000 to something like 3001?

Thank you very much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LindyKyaw
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2008-01-02
Los Angeles
 

There is a table in the database which stored increment id of order.
It is called “eav_entity_store” table.
You can check which entity type id belongs to which entity by looking at eav_entity_type table.
You can run following query to update last increment id for the order.

update eav_entity_store
inner join eav_entity_type on eav_entity_type
.entity_type_id eav_entity_store.entity_type_id
set eav_entity_store
.increment_last_id=3001 
where eav_entity_type
.entity_type_code='order';
 
Magento Community Magento Community
Magento Community
Magento Community
 
long2k9
Jr. Member
 
Total Posts:  10
Joined:  2009-02-24
 

Hi,

Thank you for your fast reply. I tried your instruction, and I placed a test order on my site. The Order ID changed from 100000018 to 100003001. How do I get rid off the “10000”? I only want to display “3001” only.

Thank you very much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hydra
Guru
 
Avatar
Total Posts:  378
Joined:  2008-08-26
Amsterdam
 

Hi,

some more info about order,invoice,shipping numbers:
http://eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/
.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

I ran this:

update `eav_entity_type` set `increment_pad_length`=5 where `entity_type_code`=’order’;
update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id=26652 where eav_entity_type.entity_type_code=’order’;

I also changed padlength in app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php

public function getPadLength()
{
$padLength = $this->getData(’pad_length’);
if (empty($padLength)) {
$padLength = 0;// Was 8
}
return $padLength;
}

I don’t know if the code change was important, however I now have sensible length order numbers.

I then updated the others:

update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id=67281 where eav_entity_type.entity_type_code=’invoice’;
update `eav_entity_type` set `increment_pad_length`=5 where `entity_type_code`=’invoice’;
update eav_entity_store inner join eav_entity_type on eav_entity_type.entity_type_id = eav_entity_store.entity_type_id set eav_entity_store.increment_last_id=32495 where eav_entity_type.entity_type_code=’shipment’;
update `eav_entity_type` set `increment_pad_length`=5 where `entity_type_code`=’shipment’;

I hope you can see what has gone on there. It works fine.

@hydra the delete order stuff in that blog doesn’t help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
back2007
Member
 
Total Posts:  59
Joined:  2009-03-30
 

Did anyone try this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
cristache
Member
 
Total Posts:  72
Joined:  2008-12-06
Bucuresti - Romania
 

Does anyone know how to change the increment value of an order from 1 to 3?
Let me give an example to be more explicit: if an order number is let’s say 16, the very next order could be 19? So the order number will be incremented with 3, not with 1.

Thanks, Cristi

 
Magento Community Magento Community
Magento Community
Magento Community
 
moleygunn
Member
 
Total Posts:  73
Joined:  2008-11-25
 

Hi cristache,

Did you find the answer to your question? I need to increment my order by 1000.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cristache
Member
 
Total Posts:  72
Joined:  2008-12-06
Bucuresti - Romania
 

sorry, didn’t find a solution yet. Still hoping someone can and will help us smile

cheers, cristi

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

Cristache

The order/invoice increment number is controlled from

app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php in the “getNextId” function and the $next variable.

public function getNextId()
    
{
        $last 
$this->getLastId();
        
        if (
strpos($last$this->getPrefix())===0{
            $last 
= (int)substr($laststrlen($this->getPrefix()));
        
else {
            $last 
= (int)$last;
        
}
        
        $next 
$last+1;

Be aware that if you change $next=$last+1; to $last+3; it will increment the order numbers by 3 but will also increment the invoice numbers by 3 and most tax offices do not like to see non-consecutive invoice numbers.  Also as this is core code you will have to put it into the local folder if you don’t want it overwritten in the next upadate.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cristache
Member
 
Total Posts:  72
Joined:  2008-12-06
Bucuresti - Romania
 

Thanks clorne, I will test that and post here afterwads.
One more question, what is the path where I should put Numeric.php so that it wouldn’t be affected by upgrades?
Cheers, Cristi

 
Magento Community Magento Community
Magento Community
Magento Community
 
jazkat
Sr. Member
 
Total Posts:  154
Joined:  2009-07-09
 

Check-out also this post!!

http://webdevster.com/ecommerce/magento/change-eav_entity_store-starting-numbers-for-orders-invoices-shipments-and-credit-memos

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2