Try the Demo

Magento Forum

   
Page 2 of 7
Custom order number, or at least custom starting number
 
nikkstocks
Member
 
Total Posts:  47
Joined:  2008-06-08
 

now THAT, btbc, would be very very useful if it can be implemented in magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jacky2008
Member
 
Total Posts:  43
Joined:  2008-04-15
 

Any body have successed?  Please share your code and process.

Thank you very much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
barrmy
Sr. Member
 
Avatar
Total Posts:  102
Joined:  2008-06-03
 

success with what?

i changed the order number from 000000001 to 148560001 by using phpmyadmin and changing the information in eav_entity_store, increment_last_id field

 
Magento Community Magento Community
Magento Community
Magento Community
 
joff
Jr. Member
 
Total Posts:  27
Joined:  2008-06-27
 

Changed padding to 0 (below) but still getting padding of 8. Also cleared all EAV cache. Why does that not work?

update `eav_entity_type` set `increment_pad_length`=0 where `entity_type_code`=’order’;

 
Magento Community Magento Community
Magento Community
Magento Community
 
joff
Jr. Member
 
Total Posts:  27
Joined:  2008-06-27
 

Update. Was able to get it to work by doing the following ...

Go to app/code/core/Mage/Eav/Model/Entity/Increment/abstract.php it appears that the if(empty($padLength) ) is evaluating to true. When I change $padLength to 0 it works even though it should have been picking up 0 padding which I set in the eav_entity_type table.

$padLength = $this->getData(’pad_length’);
if (empty($padLength)) {
$padLength = 0; // this was 8

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

Hi there,

I tried to code an extension for European shops with consecutive numbering, but I am not able to get it done. This is my config.xml:

<?xml version="1.0"?>
<config>
    <
modules>
        <
Pulpmedia_ConsecutiveNumbering>   
            <
version>0.1.0</version>
        </
Pulpmedia_ConsecutiveNumbering>
    </
modules>
    <global>       
        <
models>
            <
consecutivenumbering>
                <class>
Pulpmedia_ConsecutiveNumbering_Model</class>               
            </
consecutivenumbering>
            <
eav>
                <
rewrite>
                    <
entity_increment>Pulpmedia_ConsecutiveNumbering_Model_Entity_Increment</entity_increment>
                </
rewrite>
            </
eav>
        </
models>       
    </global>   
</
config>

this is /app/code/local/Pulpmedia/ConsecutiveNumbering/Entity/Increment/Numeric.php (for testing with a random number):

<?php

class Pulpmedia_ConsecutiveNumbering_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Numeric
{
    
public function getNextId()
    
{        
        $next 
rand(1000,100000);
        
        return 
$this->format($next);
    
}
}

... and this is my /app/code/local/Pulpmedia/ConsecutiveNumbering/Model/ConsecutiveNumbering.php

<?php
class Pulpmedia_ConsecutiveNumbering_Model_ConsecutiveNumbering extends Mage_Core_Model_Abstract
   
      {
   
        
   
      }

I tried to place an order an do not get a random number between 1000 and 100000. Could anyone help me here please?

J.

Image Attachments
structure.png
 Signature 

Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale
Guru
 
Avatar
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

first, in your config.xml this should be

<eav>
                <
rewrite>
                    <
entity_increment>Pulpmedia_ConsecutiveNumbering_Model_Entity_Increment_Numeric</entity_increment>
                </
rewrite>
            </
eav>

There should be also a file Pulpmedia_ConsecutiveNumbering.xml in app/etc/modules which contains

<?xml version="1.0"?>
<config>
    <
modules>
        <
Pulpmedia_ConsecutiveNumbering>
            <
active>true</active>
            <
codePool>local</codePool>
        </
Pulpmedia_ConsecutiveNumbering>
    </
modules>
</
config>

Go to the shopbackend System->Configuration->Advanced and take a look your module is loaded or not.

Cheers

Stefan

 Signature 

mzentrale | eCommerce - eBusiness
Agentur für eCommerce Beratung, Entwicklung & Marketing.
Magento™ Silver Partner
----

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

anybody got a good idea to sync the invoice/order number of multiple stores? should order number and invoice number always be the same? or do you think it is better to have a different one?

we have three stores (= six store views) and we think about having different order numbers and consecutive numbering of all stores for invoice.

does anybody have a good idea how to code this (in general)? i would post an extension here immediately, if someone’s got a good idea for this…

 Signature 

Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria

 
Magento Community Magento Community
Magento Community
Magento Community
 
btbc
Sr. Member
 
Total Posts:  95
Joined:  2008-06-11
 

I personally feel that this *needs* to be part of the cart itself.

I would not make any core changes in fear of future upgrades… but that is just me.

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

our client wants consecutive ordernumbers for all stores in the system and the SAME number for the invoice. how can I handle this?

 Signature 

Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria

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

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.

 Signature 

Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria

 
Magento Community Magento Community
Magento Community
Magento Community
 
nafnaf1000
Sr. Member
 
Total Posts:  209
Joined:  2008-02-21
 

@scree

if you do it this way will it cause any problems on updates?

I want to have my order number similar to amazon.

i want to use the 9 numbers. start it from 465784268 or what ever....ether increment in 9 for every order or just have it random. (wold be nice to have an extra 3 digit number for each order, like a store code)

can you help please.

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

@nafna1000: I don’t think so. smile --- I have a full working demoshop (copy of liveshop) and will try updating to 1.1.5 here. will post my results here, if it works without problems.

 Signature 

Pulpmedia GmbH | Social Media Marketing Agentur, Linz
Linzer Straße 1, A-4040 Linz
Austria

 
Magento Community Magento Community
Magento Community
Magento Community
 
nafnaf1000
Sr. Member
 
Total Posts:  209
Joined:  2008-02-21
 

Thanks,

Please let us know, I want to go live as this is one of a few loos ends that i still have to complete.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rrochelle
Jr. Member
 
Total Posts:  11
Joined:  2008-08-15
 

Hi!

When I try to insert as suggested, I am getting the following error:

#1452 - Cannot add or update a child row: a foreign key constraint fails (`db123456789/eav_entity_store`, CONSTRAINT `FK_eav_entity_store_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE)

Any clues anyone?

I am running 1.1.6 and just have one store with one storeview…

Thanks,
rrochelle

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