Exemple #1
0
 /**
  * Set shipping address
  *
  * @param \Magento\Quote\Api\Data\AddressInterface $address
  * @return $this
  */
 public function setShippingAddress(\Magento\Quote\Api\Data\AddressInterface $address = null)
 {
     if ($this->getIsMultiShipping()) {
         $this->addAddress($address->setAddressType(Address::TYPE_SHIPPING));
     } else {
         $old = $this->getShippingAddress();
         if (!empty($old)) {
             $old->addData($address->getData());
         } else {
             $this->addAddress($address->setAddressType(Address::TYPE_SHIPPING));
         }
     }
     return $this;
 }