From dedfade56e5a73ec21f165d94a44dfbff66e0c99 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Tue, 19 Mar 2024 10:29:06 +0100 Subject: [PATCH] PIWOO-441 phone number can be prepopulated in block preview --- mollie-payments-for-woocommerce.php | 2 +- src/Gateway/GatewayModule.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index 07eae740..bffaa36c 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.6.0 + * Version: 7.5.2-beta * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 01b636b2..cc6fba01 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -893,6 +893,10 @@ public function addPhoneWhenRest($arrayContext) $phoneMandatoryGateways = ['mollie_wc_gateway_in3', 'mollie_wc_gateway_bancomatpay']; $paymentMethod = $context->payment_data['payment_method']; if (in_array($paymentMethod, $phoneMandatoryGateways)) { + $billingPhone = $context->order->get_billing_phone(); + if (!empty($billingPhone) && $this->isPhoneValid($billingPhone)) { + return; + } $billingPhone = $context->payment_data['billing_phone']; if ($billingPhone) { $context->order->set_billing_phone($billingPhone);