60 \
Magento\Customer\Model\Address\Config $addressConfig,
67 $this->_addressConfig = $addressConfig;
69 parent::__construct($context,
$data);
77 $this->pageConfig->getTitle()->set(
__(
'Address Book'));
78 return parent::_prepareLayout();
86 return $this->
getUrl(
'customer/address/new', [
'_secure' =>
true]);
94 if ($this->getRefererUrl()) {
95 return $this->getRefererUrl();
97 return $this->
getUrl(
'customer/account/', [
'_secure' =>
true]);
105 return $this->
getUrl(
'customer/address/delete');
114 return $this->
getUrl(
'customer/address/edit', [
'_secure' =>
true,
'id' => $addressId]);
131 $addresses = $this->customerRepository->getById($this->currentCustomer->getCustomerId())->getAddresses();
137 if (!in_array(
$address->getId(), $primaryAddressIds)) {
141 return empty($additional) ?
false : $additional;
150 public function getAddressHtml(\
Magento\Customer\Api\Data\AddressInterface
$address =
null)
154 $renderer = $this->_addressConfig->getFormatByCode(
'html')->getRenderer();
155 return $renderer->renderArray($this->addressMapper->toFlatArray(
$address));
168 $customer = $this->customerRepository->getById($this->currentCustomer->getCustomerId());
197 return $this->addressRepository->getById($addressId);
getAddressById($addressId)
getData($key='', $index=null)
__construct(\Magento\Framework\View\Element\Template\Context $context, CustomerRepositoryInterface $customerRepository, AddressRepositoryInterface $addressRepository, \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer, \Magento\Customer\Model\Address\Config $addressConfig, Mapper $addressMapper, array $data=[])
getUrl($route='', $params=[])
setData($key, $value=null)
getAddressEditUrl($addressId)