Esempio n. 1
0
 /**
  * @param \Magento\Sales\Model\Order\Address $address
  * @return $this
  */
 public function addAddress(\Magento\Sales\Model\Order\Address $address)
 {
     $address->setOrder($this)->setParentId($this->getId());
     if (!$address->getId()) {
         $this->getAddressesCollection()->addItem($address);
         $this->setDataChanges(true);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * @param \Magento\Sales\Model\Order\Address $address
  * @return $this
  */
 public function addAddress(\Magento\Sales\Model\Order\Address $address)
 {
     $address->setOrder($this)->setParentId($this->getId());
     if (!$address->getId()) {
         $this->setAddresses(array_merge($this->getAddresses(), [$address]));
         $this->setDataChanges(true);
     }
     return $this;
 }
Esempio n. 3
0
 /**
  * Get link to edit order address page
  *
  * @param \Magento\Sales\Model\Order\Address $address
  * @param string $label
  * @return string
  */
 public function getAddressEditLink($address, $label = '')
 {
     if ($this->_authorization->isAllowed('Magento_Sales::actions_edit')) {
         if (empty($label)) {
             $label = __('Edit');
         }
         $url = $this->getUrl('sales/order/address', array('address_id' => $address->getId()));
         return '<a href="' . $url . '">' . $label . '</a>';
     }
     return '';
 }