From e1c8b223d2b5d8c197d84cfaefb3d9fb3f0e6fe2 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Fri, 8 Aug 2025 11:45:13 +0200 Subject: [PATCH] Do not add shipping if has all properties are empty --- modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php index 4c401daa3..fa9348528 100644 --- a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php +++ b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php @@ -250,7 +250,7 @@ class PurchaseUnitFactory { } $shipping = null; try { - if ( isset( $data->shipping ) ) { + if ( isset( $data->shipping ) && ! empty( (array) $data->shipping ) ) { $shipping = $this->shipping_factory->from_paypal_response( $data->shipping ); } } catch ( RuntimeException $error ) {