From 05f3d5be1634a5d833567b4fa692c4a119a575e6 Mon Sep 17 00:00:00 2001 From: Daniel Civit Date: Mon, 4 Nov 2024 15:25:07 +0100 Subject: [PATCH] PLGWOOS-961: Add double-check before addDelivery() (#589) --- src/Services/OrderService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/OrderService.php b/src/Services/OrderService.php index e2c5ef4..fb79fe7 100644 --- a/src/Services/OrderService.php +++ b/src/Services/OrderService.php @@ -65,7 +65,7 @@ public function create_order_request( WC_Order $order, string $gateway_code, str ->addSecondChance( ( new SecondChance() )->addSendEmail( (bool) get_option( 'multisafepay_second_chance', false ) ) ) ->addData( array( 'var2' => $order->get_id() ) ); - if ( $order->needs_shipping_address() ) { + if ( $order->needs_shipping_address() && $order->has_shipping_address() ) { $order_request->addDelivery( $this->customer_service->create_delivery_details( $order ) ); }