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, 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

Magento Forum

Set customers address as delivery-address and/or invoice-address via php
Total Posts:  40
Joined:  2009-03-16
Düsseldorf, Germany

Hi there!
I’m trying to import some customers into magento 1.6 CE via php-script.
My problem is to import the addresses (delivery and invoice) - i do not understand the logic of magento how to set a address as default delivery-address or as default invoice-address. In the models i also do not find a setting for this. Is the position crucial for this? Anyone who has a solution for this?

Here is my code:


$customer Mage::getModel("customer/customer");
$row->deliveryaddress != ''{
if($row->invoiceaddress != ''{
if($row->alternativeaddress1 != ''{
if($row->alternativeaddress2 != ''{


Rafael Kutscha

EDIT: Checked my import. Really seems to be the position. Can anyone confirm this?

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