mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
Compare commits
4 Commits
6d13973c06
...
c7b84603d4
Author | SHA1 | Date | |
---|---|---|---|
|
c7b84603d4 | ||
|
24f6623016 | ||
|
ffaca2a7f3 | ||
|
1710318e80 |
@ -26,7 +26,7 @@ class OrderStatusUpdateRequest
|
||||
/**
|
||||
* @var Shipment[] list of shipments for this order
|
||||
*/
|
||||
public array $shipments;
|
||||
public array $shipments = array();
|
||||
|
||||
public function getTrackingNumberList() : array {
|
||||
$list = [];
|
||||
|
@ -19040,7 +19040,7 @@ function CheckShopTabelle($artikel)
|
||||
}
|
||||
}
|
||||
|
||||
return array("status" => true, "$auftragid" => $auftrag);
|
||||
return array("status" => true, "auftragid" => $auftrag);
|
||||
}
|
||||
|
||||
|
||||
|
@ -202,9 +202,7 @@ class Shopimporter_Woocommerce extends ShopimporterBase
|
||||
'warenkorb' => base64_encode(serialize($order)),
|
||||
];
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
|
||||
}
|
||||
|
||||
// This function searches the wcOrder for the specified WC Meta key
|
||||
@ -424,19 +422,22 @@ class Shopimporter_Woocommerce extends ShopimporterBase
|
||||
{
|
||||
/** @var OrderStatusUpdateRequest $data */
|
||||
$data = $this->CatchRemoteCommand('data');
|
||||
|
||||
if ($data->orderStatus !== OrderStatus::Completed)
|
||||
return;
|
||||
|
||||
if (isset($data->shipments)) {
|
||||
$trackingCode = $data->shipments[0]?->trackingNumber;
|
||||
}
|
||||
|
||||
if (!empty($trackingCode)) {
|
||||
$this->client->post('orders/'.$data->orderId.'/notes', [
|
||||
$this->client->post('orders/'.$data->shopOrderId.'/notes', [
|
||||
'note' => 'Tracking Code: ' . $trackingCode
|
||||
]);
|
||||
|
||||
$this->logger->info("WooCommerce Tracking Code Rückmeldung für Auftrag: ".$data->orderId,
|
||||
[
|
||||
'orderId' => $data->orderId,
|
||||
'orderId' => $data->shopOrderId,
|
||||
'trackingCode' => $trackingCode
|
||||
]
|
||||
);
|
||||
@ -447,7 +448,7 @@ class Shopimporter_Woocommerce extends ShopimporterBase
|
||||
'meta_data' => [
|
||||
[
|
||||
'key' => 'tracking_code',
|
||||
'value' => $data->shipments[0]?->trackingNumber
|
||||
'value' => $trackingCode
|
||||
],
|
||||
[
|
||||
'key' => 'shipping_carrier',
|
||||
@ -455,11 +456,11 @@ class Shopimporter_Woocommerce extends ShopimporterBase
|
||||
]
|
||||
],
|
||||
];
|
||||
$this->client->put('orders/'.$data->orderId, $updateData);
|
||||
$this->client->put('orders/'.$data->shopOrderId, $updateData);
|
||||
|
||||
$this->logger->info("WooCommerce Statusrückmeldung 'completed' für Auftrag: ".$data->orderId,
|
||||
[
|
||||
'orderId' => $data->orderId,
|
||||
'orderId' => $data->shopOrderId,
|
||||
'status' => $this->statusCompleted
|
||||
]
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user