Prestashop: add missing strval() calls

This commit is contained in:
Andreas Palm 2023-02-05 22:22:44 +01:00
parent 36322b0171
commit f495964d2b

View File

@ -195,7 +195,6 @@ class Shopimporter_Presta extends ShopimporterBase
$fetchedOrders = [];
foreach ($ordersToProcess as $currentOrderId) {
$this->Log("Importing order from presta", [$this->data, $ordersToProcess, $currentOrderId]);
$order = $this->prestaRequest('GET', "orders/$currentOrderId");
$order = $order->order;
$cart = [];
@ -217,7 +216,7 @@ class Shopimporter_Presta extends ShopimporterBase
$invoiceCountry = $this->prestaRequest('GET', "countries/$invoiceAddress->id_country");
$invoiceCountry = $invoiceCountry->country;
$cart['name'] = "$invoiceAddress->firstname $invoiceAddress->lastname";
if (!empty($invoiceAddress->company)) {
if (!empty(strval($invoiceAddress->company))) {
$cart['ansprechpartner'] = $cart['name'];
$cart['name'] = strval($invoiceAddress->company);
}
@ -231,14 +230,14 @@ class Shopimporter_Presta extends ShopimporterBase
$cart['ustid'] = strval($invoiceAddress->vat_number);
$cart['land'] = strval($invoiceCountry->iso_code);
if ($order->id_address_invoice != $order->id_address_delivery) {
if (strval($order->id_address_invoice) != strval($order->id_address_delivery)) {
$deliveryAddress = $this->prestaRequest('GET', "addresses/$order->id_address_delivery");
$deliveryAddress = $deliveryAddress->address;
$deliveryCountry = $this->prestaRequest('GET', "countries/$deliveryAddress->id_country");
$deliveryCountry = $deliveryCountry->country;
$cart['abweichendelieferadresse'] = 1;
$cart['lieferadresse_name'] = "$deliveryAddress->firstname $deliveryAddress->lastname";
if (!empty($deliveryAddress->company)) {
if (!empty(strval($deliveryAddress->company))) {
$cart['lieferadresse_ansprechpartner'] = $cart['lieferadresse_name'];
$cart['lieferadresse_name'] = strval($deliveryAddress->company);
}