shopimport improvements

This commit is contained in:
OpenXE 2024-06-20 14:18:20 +02:00
parent 04daacb227
commit 610ed35218
3 changed files with 1713 additions and 1928 deletions

View File

@ -17334,7 +17334,7 @@ function CheckShopTabelle($artikel)
return $taxrates;
}
function ImportAuftrag($adresse,$warenkorb,$projekt,$shop="",$auftrag=0)
function ImportAuftrag($adresse,$warenkorb,$projekt,$shop="",$auftrag=0) : array
{
$this->RunHook('ImportAuftragBefore',4, $adresse,$warenkorb,$projekt,$shop);
if(!empty($this->app->stringcleaner)){
@ -18822,8 +18822,9 @@ function CheckShopTabelle($artikel)
}
}
} else {
$this->LogFile('Importauftrag Shop '.$shop.' Fehler: Kein Portoartikel vorhanden',['Onlinebestellnummer' => $warenkorb['onlinebestellnummer']]);
return(null);
$error_msg = 'Importauftrag Shop '.$shop.' Fehler: Kein Portoartikel vorhanden';
$this->LogFile($error_msg,['Onlinebestellnummer' => $warenkorb['onlinebestellnummer']]);
return(array("status" => false, "message" => $error_msg, "onlinebestellnummer" => $warenkorb['onlinebestellnummer']));
}
}
$umsatzsteuer_porto = $this->app->DB->Select("SELECT umsatzsteuer FROM artikel WHERE id='$artikelporto' LIMIT 1");
@ -19171,7 +19172,7 @@ function CheckShopTabelle($artikel)
}
}
return $auftrag;
return array("status" => true, "$auftragid" => $auftrag);
}

File diff suppressed because it is too large Load Diff

View File

@ -452,10 +452,13 @@ class Shopimporter_Mirakl extends ShopimporterBase {
$cart['kundennummer'] = $order->customer->customer_id;
$cart['name'] = ($order->customer->civility?$order->customer->civility." ":"").$order->customer->firstname." ".$order->customer->lastname;
if (!empty(strval($order->customer->company))) {
if (!empty($order->customer->billing_address->company)) {
$cart['anrede'] = 'firma';
$cart['ansprechpartner'] = $cart['name'];
$cart['name'] = strval($order->customer->company);
$cart['name'] = strval($order->customer->billing_address->company);
}
$cart['strasse'] = strval($order->customer->billing_address->street_1);
$cart['adresszusatz'] = strval($order->customer->billing_address->street_2);
$cart['telefon'] = strval($order->customer->billing_address->phone);
@ -472,10 +475,12 @@ class Shopimporter_Mirakl extends ShopimporterBase {
$cart['lieferadresse_land'] = $this->app->DB->Select($sql);
$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))) {
$cart['lieferadresse_ansprechpartner'] = $cart['lieferadresse_name'];
$cart['lieferadresse_name'] = strval($deliveryAddress->company);
}
$cart['lieferadresse_strasse'] = strval($order->customer->shipping_address->street_1);
$cart['lieferadresse_adresszusatz'] = strval($order->customer->shipping_address->street_2);
$cart['lieferadresse_telefon'] = strval($order->customer->shipping_address->phone);