I changed the table "eav_entity_store" in my DB so i get a customer_increment_id like this "2015_00001". This works fine and every new customer get this id (2015_xxxxx) in "customer_entity.increment_id".

The normal value for this colmn is NULL and the system use entity_id for the customer_id.

Now i want do print this increment_id in my invoice/shipping/creditmemo-PDFs instead the normal customer_id. Is there an easy way to get the increment_id from the customer_id?

I have the place in my Abstract.php to print the id, but i don´t find the value for the increment_id. I only got the normal custumer_id [ $order->getCustomerId() ].

1 Answer 1


Found a solution

I directly get the increment_id from the DB

$newConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
$query = $newConnection->select()->from($tablePrefix . 'customer_entity')
         ->where('entity_id = ' . $order->getCustomerId(). ' AND store_id = ' . $order->getStoreId());
$row = $newConnection->fetchRow($query);
$customerid = $row['increment_id'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.