/** * @return string */ public function getPrimaryBillingAddressEditUrl() { if (!$this->getCustomer()) { return ''; } else { $address = $this->currentCustomerAddress->getDefaultBillingAddress(); $addressId = $address ? $address->getId() : null; return $this->_urlBuilder->getUrl('customer/address/edit', ['id' => $addressId]); } }
/** * HTML for Billing Address * * @return string */ public function getPrimaryBillingAddressHtml() { try { $address = $this->currentCustomerAddress->getDefaultBillingAddress(); } catch (NoSuchEntityException $e) { return __('You have not set a default billing address.'); } if ($address) { return $this->_getAddressHtml($address); } else { return __('You have not set a default billing address.'); } }
/** * test getDefaultShippingAddress */ public function testGetDefaultShippingAddress() { $this->currentCustomerMock->expects($this->once())->method('getCustomerId')->will($this->returnValue($this->customerCurrentId)); $this->customerAddressServiceMock->expects($this->once())->method('getDefaultShippingAddress')->will($this->returnValue($this->customerAddressDataMock)); $this->assertEquals($this->customerAddressDataMock, $this->currentCustomerAddress->getDefaultShippingAddress()); }