From 42210bad4b7aeab3e0b02d3194bccd6bfb65f6eb Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Tue, 19 Nov 2024 12:48:11 +0100 Subject: [PATCH] =?UTF-8?q?Refaktoryzacja=20przypisania=20adresu=20klienta?= =?UTF-8?q?=20w=20cron.php,=20poprawiaj=C4=85c=20logik=C4=99=20przypisywan?= =?UTF-8?q?ia=20ulicy,=20miasta=20i=20kodu=20pocztowego=20z=20r=C3=B3?= =?UTF-8?q?=C5=BCnych=20=C5=BAr=C3=B3de=C5=82=20danych.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/cron.php b/cron.php index 425394c..01a9ab6 100644 --- a/cron.php +++ b/cron.php @@ -510,24 +510,27 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se $street = ''; $city = ''; $postal_code = ''; + if ( $order['client_street'] ) - { $street = $order['client_street']; - $city = $order['client_city']; - $postal_code = $order['client_postal_code']; - } else if ( $paczkomatData ) - { $street = $paczkomatData['address']; - $city = $paczkomatData['city']; - $postal_code = $paczkomatData['postalCode']; - } else if ( $orlenPointData ) - { $street = $orlenPointData['address']; + + if ( $order['client_city'] ) + $city = $order['client_city']; + else if ( $paczkomatData ) + $city = $paczkomatData['city']; + else if ( $orlenPointData ) $city = $orlenPointData['city']; + + if ( $order['client_postal_code'] ) + $postal_code = $order['client_postal_code']; + else if ( $paczkomatData ) + $postal_code = $paczkomatData['postalCode']; + else if ( $orlenPointData ) $postal_code = $orlenPointData['postalCode']; - } $postData = [ 'idExternal' => $order['id'],