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

Custom order number, or at least custom starting number
 
cristache
Member
 
Total Posts:  72
Joined:  2008-12-06
Bucuresti - Romania
 

Does anyone one know how to change the increment value? For example, if an order number is 16, the very next order to be 19 (so it will be incremented by 3, not by 1).

Thanks, Cristi

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anna Varmon
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2009-04-15
 

hi, Cristi
It seems that there was a mod for custom order numbers, prefixes and increment rates at http://adjustware.com

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

Thanks, Anna smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
brianb421
Sr. Member
 
Total Posts:  196
Joined:  2009-04-23
 
scree - 26 August 2008 12:20 AM

I did it. Consecutive order numbers AND invoice numbers.

The trick:

In eav_entity_store I added two entries:

for orders:

entity_type11
store_id
0
increment_prefix
0
increment_last_id
000080000 (to start with)

for invoices:
entity_type16
store_id
0
increment_prefix
0
increment_last_id
000010000 (to start with)

additionally I changed the values of “increment_per_store” from 1 to 0 for entity_type_code 11 and 16 (order and invoice) in eav_entity_type.

hth,
j.

The entity types 11 & 16 appear to be outdated for vers. 1.3.1.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brianb421
Sr. Member
 
Total Posts:  196
Joined:  2009-04-23
 

here’s my solution.  I’m running 1.3.1

Step 1:
Create a test order
Open the order & create:
* an invoice
* a shipment
* a credit memo

(this enters the initial lines into the eav_entity_store table in step 3)

Step 2:
Go to System - Cache Management
Uncheck EAV types & attributes
Save

Step 3:
Open your MySql database (ask your host if ya don’t know how to do this.  it’s likely in your hosting control panel somewhere.)
Open your magento database
Go to the table - eav_entity_store

Click Export tab
* Select CSV
* Fields terminated by: Change ; to ,
* Fields enclosed by: Change " to “
* Check the box “Put fields names in the first row”
* Check the box “Save as file”
* Go

Open file in Excel

Info will look something like this:

entity_store_id entity_type_id store_id increment_prefix increment_last_id
1 1 0 0 2
2 4 1 1 100000001
3 18 1 1 100000001
4 24 1 1 100000001
5 28 1 1 100000001

change the 100000001’s to a 9 digit number of your choice starting with a 1.
Ex. 130351000
(If you start it with anything but a 1 it will add a one to the beginning of your number, making it a 10 digit number.)
Each line is for invoice, order, credit, or shipment.  You can play around to see which is which.

Once you’ve made your changes, delete the first row with the column names.

Save the new file, keeping it a .csv file.

Import back into MySql
* Click the Import tab
* Browse for the csv file
* Check the “Replace table data with file” box
* Fields terminated by: Change ; to ,
* Go

Page should say: “Import has been successfully finished”

Place a test order
The numbers should start with your new ##’s.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adjustware
Guru
 
Avatar
Total Posts:  654
Joined:  2009-05-11
 
Anna Varmon - 20 May 2009 12:52 AM

hi, Cristi
It seems that there was a mod for custom order numbers, prefixes and increment rates at http://adjustware.com

Hi, we are glad to inform that new revised version of the Custom Order Number extension now is available at the magento
connect too: http://www.magentocommerce.com/extension/1419/custom-order-number-pro

 
Magento Community Magento Community
Magento Community
Magento Community
 
netsocial
Jr. Member
 
Total Posts:  7
Joined:  2008-03-12
 

What about alphanumeric order numbers in the admin ?

I have it incrementing just fine, but only numeric invoice numbers will show up in Admin > Sales > Invoices > Invoice # column.  As soon as there is a letter in the invoice number, the invoice, shipping and credit pages only show “0” in that column.  The alphanumeric order number shows up just fine in Orders overview as well as in the underlying Invoice and Shipping tabs. 

Any ideas on how to get the Invoice, Shipping and Credit overview pages to display alphanumerics?

For example, the order page shows BB-OR000001 just fine.  under that order’s invoices it shows BB-IN000001 just fine.  However, if i go to the invoice management page, the invoice number and order number columns only show “0” (if i rename them to simply OR00001 or IN00001, it does the same thing...)

Any suggestions?
EP

 
Magento Community Magento Community
Magento Community
Magento Community
 
Griff1324
Member
 
Total Posts:  39
Joined:  2008-12-04
 

I too am experiencing the same problem as netsocial.  If anyone has a way to correct this, I would greatly appreciate it!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adjustware
Guru
 
Avatar
Total Posts:  654
Joined:  2009-05-11
 

Shipping and Credit overview pages assume that numbers are integers and convert them to integers.  So

intVal('BB-OR000001') == 0;
Our Custom Order Number extension overwrites this grids and correct column types.
 
Magento Community Magento Community
Magento Community
Magento Community
 
agarvey
Member
 
Total Posts:  55
Joined:  2008-06-23
 

Thanks for all of the posts. 

I am doing something similar, but it is not as complicated.  We have one store that starts with a “10” and one store that starts with a “1”.  This is confusing because when you just glance at the orders it looks like they are coming from the same store.  How do I skip over 10 and just make the one store start with 11 or 22.

When I looked at my eav_entity_store table, it didn’t seem to show me what I needed.  We have many stores and this is all that it has in it:
Full Texts entity_store_id entity_type_id store_id increment_prefix increment_last_id
Edit Delete 2 1 0 0 000000004
Edit Delete 6 11 5 5 500000001
Edit Delete 7 11 1 1 100000009
Edit Delete 8 4 7 7 700000007
Edit Delete 9 18 7 7 700000004
Edit Delete 10 24 7 7 700000002
Edit Delete 11 28 7 7 700000001

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
scree
Sr. Member
 
Avatar
Total Posts:  137
Joined:  2008-07-14
Linz
 

Could somebody please confirm, that the IDs in entity_store_id changed for order and invoice?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sterg17
Sr. Member
 
Total Posts:  94
Joined:  2009-11-06
 

I get the following error when I run that code in PHP my admin:

MySQL said:

#1146 - Table ‘MYDATABASE.eav_entity_type’ doesn’t exist

------------------------------------------

Im trying to change the length of order numbers, but i get that error message above. Any suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
scree
Sr. Member
 
Avatar
Total Posts:  137
Joined:  2008-07-14
Linz
 

I tried the Adjustware extension. It’s the best one around.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jetsetter
Member
 
Total Posts:  33
Joined:  2008-06-29
 

Magento core defines this column as a numeric when displaying, so just remove this line in app\code\core\Mage\Adminhtml\Block\Sales\Shipment\grid.php

Before starting at line 61:

$this->addColumn('increment_id', array(
            
'header'    => Mage::helper('sales')->__('Shipment #'),
            
'index'     => 'increment_id',
            
'type'      => 'number',
        ));
to
$this->addColumn('increment_id', array(
            
'header'    => Mage::helper('sales')->__('Shipment #'),
            
'index'     => 'increment_id',
        ));

Now, can anyone help me get the tracking number on this grid??!

 
Magento Community Magento Community
Magento Community
Magento Community
 
stevecgarry
Member
 
Total Posts:  38
Joined:  2010-02-25
Co Meath Ireland
 

on a very basic site I did a while back, where we had exactly this issue, I did a very smple order number.

Format is yymmdd-99999, where the number is reset to one on the first order after midnight. That was one line of code that checks the date against the date of the order, and if they don’t agree, it changes the date to the current date, and then resets the number to 1. The next number then sees the correct date, so adds 1 to the sequence and then saves it back to file.

Avoids the numbers being given away, and provides a unique number for future checks and looking up.

Steve

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top