From 389a29793ad1397559290ff47fbe4ceb6412cc2c Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Thu, 29 Aug 2024 18:43:26 +0200 Subject: [PATCH] mirakl auftrag import additional info --- www/lib/class.erpapi.php | 3 +++ www/pages/shopimporter_mirakl.php | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index 1e28a58a..a436ed3e 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -17727,6 +17727,9 @@ function CheckShopTabelle($artikel) if($doctype === 'angebot'){ $this->app->DB->Update("UPDATE angebot SET anfrage = '".$this->app->DB->real_escape_string($warenkorb['onlinebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1"); } + if($doctype === 'auftrag'){ + $this->app->DB->Update("UPDATE auftrag SET ihrebestellnummer = '".$this->app->DB->real_escape_string($warenkorb['ihrebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1"); + } $this->app->DB->Update("UPDATE $doctype SET belegnr='$belegnr', diff --git a/www/pages/shopimporter_mirakl.php b/www/pages/shopimporter_mirakl.php index b3f83aa0..5f50d34e 100644 --- a/www/pages/shopimporter_mirakl.php +++ b/www/pages/shopimporter_mirakl.php @@ -522,9 +522,9 @@ class Shopimporter_Mirakl extends ShopimporterBase { $cart['lieferadresse_name'] = ($order->customer->shipping_address->civility?$order->customer->shipping_address->civility." ":"").$order->customer->shipping_address->firstname." ".$order->customer->shipping_address->lastname; - if (!empty(strval($order->customer->shipping_address->company))) { + if (!empty($order->customer->shipping_address->company)) { $cart['lieferadresse_ansprechpartner'] = $cart['lieferadresse_name']; - $cart['lieferadresse_name'] = strval($deliveryAddress->company); + $cart['lieferadresse_name'] = strval($order->customer->shipping_address->company); } $cart['lieferadresse_strasse'] = strval($order->customer->shipping_address->street_1); @@ -532,6 +532,16 @@ class Shopimporter_Mirakl extends ShopimporterBase { $cart['lieferadresse_telefon'] = strval($order->customer->shipping_address->phone); $cart['lieferadresse_plz'] = strval($order->customer->shipping_address->zip_code); $cart['lieferadresse_ort'] = strval($order->customer->shipping_address->city); + + $cart['internebemerkung'] = strval($order->customer->shipping_address->additional_info); + + if (is_array($order->order_additional_fields)) { + $order_reference = array_search('customer-order-reference',array_column($order->order_additional_fields,'code')); + + if ($order_reference !== false) { + $cart['ihrebestellnummer'] .= $order->order_additional_fields[$order_reference]->value; + } + } $cart['zahlungsweise'] = strval($order->payment_type); @@ -544,7 +554,6 @@ class Shopimporter_Mirakl extends ShopimporterBase { $cart['articlelist'] = []; - $shipping_tax_amount = 0; foreach ($order->order_lines as $order_row) {