diff --git a/modules/ppcp-googlepay/src/Endpoint/UpdatePaymentDataEndpoint.php b/modules/ppcp-googlepay/src/Endpoint/UpdatePaymentDataEndpoint.php index 63b461738..803a73f3f 100644 --- a/modules/ppcp-googlepay/src/Endpoint/UpdatePaymentDataEndpoint.php +++ b/modules/ppcp-googlepay/src/Endpoint/UpdatePaymentDataEndpoint.php @@ -163,8 +163,10 @@ class UpdatePaymentDataEndpoint { return array(); } + $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' ); + return array( - 'defaultSelectedOptionId' => $shipping_options[0]['id'], + 'defaultSelectedOptionId' => ( $chosen_shipping_methods[0] ?? null ) ? $chosen_shipping_methods[0] : $shipping_options[0]['id'], 'shippingOptions' => $shipping_options, ); }