Skip to content

Commit 9dbabdf

Browse files
committed
chore: add customer addresses onto getCustomer
1 parent d81ef13 commit 9dbabdf

File tree

1 file changed

+8
-1
lines changed
  • src/app/code/community/Zendesk/Zendesk/Helper

1 file changed

+8
-1
lines changed

src/app/code/community/Zendesk/Zendesk/Helper/Data.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ public function getCustomer($customer)
740740
$urlModel = Mage::getModel('adminhtml/url')->setStore('admin');
741741
$adminUrl = $urlModel->getUrl('adminhtml/zendesk/redirect', array('id' => $customerId, 'type' => 'customer'));
742742

743-
return array(
743+
$info = array(
744744
'id' => $customerId,
745745
'type' => 'customer',
746746
'url' => $adminUrl,
@@ -749,7 +749,14 @@ public function getCustomer($customer)
749749
'last_name' => $customer->getLastname(),
750750
'created_at' => $customer->getCreatedAt(),
751751
'updated_at' => $customer->getUpdatedAt(),
752+
'addresses' => array()
752753
);
754+
755+
foreach($customer->getAddressesCollection() as $address) {
756+
$info['addresses'][] = $this->formatAddress($address);
757+
}
758+
759+
return $info;
753760
}
754761

755762
public function getFilteredOrders($customerFilters, $generalFilters)

0 commit comments

Comments
 (0)