Ejemplo n.º 1
0
 /**
  * @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]);
     }
 }
Ejemplo n.º 2
0
 /**
  * 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.');
     }
 }
Ejemplo n.º 3
0
 /**
  * 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());
 }