Dodanie sprawdzenia statusu zamówienia przed aktualizacją w funkcji synchronizacji zamówień

This commit is contained in:
2025-07-14 14:58:34 +02:00
parent 0ddcedfae2
commit d63c8d4309

View File

@@ -710,7 +710,10 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se
$shop_status_id = \front\factory\ShopStatuses::get_shop_status_by_integration_status_id( 'apilo', $responseData['status'] ); $shop_status_id = \front\factory\ShopStatuses::get_shop_status_by_integration_status_id( 'apilo', $responseData['status'] );
$order_tmp = new Order( $order['id'] ); $order_tmp = new Order( $order['id'] );
if ( $shop_status_id )
$order_tmp -> update_status( $shop_status_id, false ); $order_tmp -> update_status( $shop_status_id, false );
$order_tmp -> update_aplio_order_status_date( date( 'Y-m-d H:i:s' ) ); $order_tmp -> update_aplio_order_status_date( date( 'Y-m-d H:i:s' ) );
echo '<p>Zaktualizowałem status zamówienia <b>' . $order['number'] . '</b></p>'; echo '<p>Zaktualizowałem status zamówienia <b>' . $order['number'] . '</b></p>';
} }