Question

I need to change all addresses (billing, shipping) street attribute. I have only entity_id (address_id) from customer_address_entity_text.
How can I do it?

Was it helpful?

Solution

$addressId = ...your id here...;
$address = Mage::getModel('customer/address')->load($addressId);
$street = 'your street here';
//or if you want to have 2 lines on the street
//$street = array('First line', 'Second line');

if($address->getId()) {
    $address->setStreet($street);
    $address->save();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top