0

I'm writing some codes to update customer address using php, but the site use 2 street fields,

when i set it like $address->setStreet1('test 1'); it's not working $address->setStreet('test 1'); ads only first field

enter image description here

EX-

$customerId = 1300;
$addressId = 920;

$customer = Mage::getModel('customer/customer')->load($customerId);
$address = $customer->getAddressById($addressId);
$address->setStreet('123 Main Street');
$address->setCity('Anytown');
$address->save();

anyone know how to fix this or other solution for set the street of existing address

1 Answer 1

1

to update Street1 and Street2 fields you just need to provide an array:

$address->setStreet(['123 Main Street', 'Street 2']);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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