diff --git a/cron.php b/cron.php index a8fb16e..0a4e56b 100644 --- a/cron.php +++ b/cron.php @@ -503,6 +503,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se $access_token = \admin\factory\Integrations::apilo_get_access_token(); $order_date = new DateTime( $order['date_order'] ); + $paczkomatData = parsePaczkomatAddress( $order['inpost_paczkomat'] ); $orlenPointData = parseOrlenAddress( $order['orlen_point'] ); @@ -516,7 +517,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se $street = $paczkomatData['address']; else if ( $orlenPointData ) $street = $orlenPointData['address']; - else if ( $order['transport_id'] == 3 ) + else if ( $order['transport_id'] == 3 or ( $order['transport_id'] == 9 and $order['orlen_point'] == null ) ) $street = 'ul. Krakowska 156/104'; if ( $order['client_city'] ) @@ -525,7 +526,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se $city = $paczkomatData['city']; else if ( $orlenPointData ) $city = $orlenPointData['city']; - else if ( $order['transport_id'] == 3 ) + else if ( $order['transport_id'] == 3 or ( $order['transport_id'] == 9 and $order['orlen_point'] == null ) ) $city = 'Rzeszów'; if ( $order['client_postal_code'] ) @@ -534,9 +535,14 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se $postal_code = $paczkomatData['postalCode']; else if ( $orlenPointData ) $postal_code = $orlenPointData['postalCode']; - else if ( $order['transport_id'] == 3 ) + else if ( $order['transport_id'] == 3 or ( $order['transport_id'] == 9 and $order['orlen_point'] == null ) ) $postal_code = '35-506'; + if ( $order['transport_id'] == 9 and $order['orlen_point'] == null ) + { + \S::send_email( 'biuro@project-pro.pl', 'Błąd integracji APILO - brak punktu ORLEN PACZKA', 'W zamówieniu #' . $order['id'] . ' wybrano dostawę ORLEN PACZKA, ale nie podano punktu odbioru. Proszę o uzupełnienie danych w panelu sklepu.' ); + } + $postData = [ 'idExternal' => $order['id'], 'isInvoice' => $order['firm_name'] ? true : false, @@ -707,6 +713,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se if ( $responseData['id'] and $responseData['status'] ) { $shop_status_id = \front\factory\ShopStatuses::get_shop_status_by_integration_status_id( 'apilo', $responseData['status'] ); + $order_tmp = new Order( $order['id'] ); if ( $shop_status_id ) diff --git a/templates_user/.DS_Store b/templates_user/.DS_Store new file mode 100644 index 0000000..dbd07c1 Binary files /dev/null and b/templates_user/.DS_Store differ diff --git a/templates_user/components/.DS_Store b/templates_user/components/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/templates_user/components/.DS_Store differ