Skip to content
Code-Schnipsel Gruppen Projekte
Commit 93958e87 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: set shipping address

Übergeordneter b99c6b72
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
...@@ -210,8 +210,12 @@ public static function onQuiqqerOrderCustomerDataSave( ...@@ -210,8 +210,12 @@ public static function onQuiqqerOrderCustomerDataSave(
return; return;
} }
$Order->setData('shipping-address', $Address->getAttributes());
$Order->setData('shipping-address-id', $Address->getId()); $ErpAddress = new QUI\ERP\Address(
\array_merge($Address->getAttributes(), ['id' => $Address->getId()])
);
$Order->setDeliveryAddress($ErpAddress);
$Order->save(); $Order->save();
} }
...@@ -293,7 +297,7 @@ public static function onOrderConfirmationEnd( ...@@ -293,7 +297,7 @@ public static function onOrderConfirmationEnd(
$Engine->fetch(dirname(__FILE__).'/Mails/orderConfirmation.html') $Engine->fetch(dirname(__FILE__).'/Mails/orderConfirmation.html')
); );
} catch (QUI\Exception $Exception) { } catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);; QUI\System\Log::writeDebugException($Exception);
} }
} }
} }
...@@ -73,10 +73,11 @@ public function getBody() ...@@ -73,10 +73,11 @@ public function getBody()
// current address // current address
$currentAddress = ''; $currentAddress = '';
$shippingAddress = $Order->getDataEntry('shipping-address-id'); $Shipping = QUI\ERP\Shipping\Shipping::getInstance()->getShippingByObject($Order);
$ShippingAddress = $Shipping->getAddress();
if (!empty($shippingAddress)) { if ($ShippingAddress) {
$currentAddress = $shippingAddress; $currentAddress = $ShippingAddress->getId();
} elseif ($User->getAttribute('quiqqer.delivery.address')) { } elseif ($User->getAttribute('quiqqer.delivery.address')) {
$currentAddress = $User->getAttribute('quiqqer.delivery.address'); $currentAddress = $User->getAttribute('quiqqer.delivery.address');
} }
......
...@@ -307,16 +307,13 @@ public function getShippingByObject($Object) ...@@ -307,16 +307,13 @@ public function getShippingByObject($Object)
return null; return null;
} }
$Shipping = $Object->getShipping(); $Shipping = $Object->getShipping();
$addressData = $Object->getDataEntry('shipping-address'); $Delivery = $Object->getDeliveryAddress();
if ($addressData) { if ($Delivery) {
$Shipping->setAddress( $Shipping->setAddress($Delivery);
new QUI\ERP\Address($addressData)
);
} }
return $Shipping; return $Shipping;
} }
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren