In one of my project, I need to be able to make an order with someone’s else address. So i’ve done some modifications to be able to show the other customer’s addresses in my address list during the checkout. Everything works fine, the only problem is that when the order is completed, the address is transfered to me and the other customer doesn’t have access to this address anymore.
So I assume there is something like address->setCustomer($myId) happening somewhere. I commented this line in customer/model/customer.php :
public function getAddressesCollection()
{
if (is_null($this->_addressesCollection)) {
$this->_addressesCollection = $this->getAddressCollection()
->setCustomerFilter($this)
->addAttributeToSelect('*');
foreach ($this->_addressesCollection as $address) {
//$address->setCustomer($this);
}
// My call to add other customer's address to the list here
}
return $this->_addressesCollection;
}
And I am adding the other customer’s addresses by adding something like this in the same function : $this->getAddressesCollection()->addItem($customer_address); But commenting this line “$address->setCustomer($this);” doesn’t seems to do the trick…
Any idea?
Thanks!