Change Increment Customer ID from 1 to 00001 with Zero Padding

customerdatabaseeavexportmagento-1

Is there a way to change the customer ID to start with 00001. Now it's just 1. I need this for importing into a different system.

So each customer number starting with 00001, 00002 and so on…

Best Answer

I would strongly advise against altering core tables or their auto increment. Instead translate it when retrieved for export/import using str_pad or sprintf i.e.:

$id = 1; $exportId = str_pad($id, 5, '0', STR_PAD_LEFT); -> 3v4l example

OR

$id = 1; $exportId = sprintf('%05d',$id); -> 3v4l example

Related Topic