From 84e168193305888925d2e0c33dfdcd03ed56999d Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 16 Oct 2024 13:04:59 +0200 Subject: [PATCH] Add new setting for the express button --- inc/settings/mollie_applepay_settings.php | 8 ++++++++ src/PaymentMethods/Applepay.php | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php index 2ef1c3fa0..92e0b305a 100644 --- a/inc/settings/mollie_applepay_settings.php +++ b/inc/settings/mollie_applepay_settings.php @@ -115,6 +115,14 @@ 'value' => isset($applePayOption['mollie_apple_pay_button_enabled_product']) ? $applePayOption['mollie_apple_pay_button_enabled_product'] : 'no', ], + [ + 'id' => 'mollie_apple_pay_button_enabled_express_checkout', + 'title' => __('Enable Apple Pay Express Button on Checkout page', 'mollie-payments-for-woocommerce'), + 'desc' => __('Enable the Apple Pay direct buy button on the Express Buttons section of the Checkout page', 'mollie-payments-for-woocommerce'), + 'type' => 'checkbox', + 'default' => 'no', + 'value' => isset($applePayOption['mollie_apple_pay_button_enabled_express_checkout']) ? $applePayOption['mollie_apple_pay_button_enabled_express_checkout'] : 'no', + ], [ 'id' => $pluginName . '_' . 'sectionend', 'type' => 'sectionend', diff --git a/src/PaymentMethods/Applepay.php b/src/PaymentMethods/Applepay.php index 63a32c9ab..7a968dcd3 100644 --- a/src/PaymentMethods/Applepay.php +++ b/src/PaymentMethods/Applepay.php @@ -32,7 +32,6 @@ public function getFormFields($generalFormFields): array $paymentMethodFormFieds = [ 'mollie_apple_pay_button_enabled_cart' => [ 'title' => __('Enable Apple Pay Button on Cart page', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: enabled or disabled */ 'desc' => __( 'Enable the Apple Pay direct buy button on the Cart page', 'mollie-payments-for-woocommerce' @@ -42,7 +41,6 @@ public function getFormFields($generalFormFields): array ], 'mollie_apple_pay_button_enabled_product' => [ 'title' => __('Enable Apple Pay Button on Product page', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: enabled or disabled */ 'desc' => __( 'Enable the Apple Pay direct buy button on the Product page', 'mollie-payments-for-woocommerce' @@ -50,6 +48,12 @@ public function getFormFields($generalFormFields): array 'type' => 'checkbox', 'default' => 'no', ], + 'mollie_apple_pay_button_enabled_express_checkout' => [ + 'title' => __('Enable Apple Pay Express Button on Checkout page', 'mollie-payments-for-woocommerce'), + 'desc' =>__('Enable the Apple Pay direct buy button on the Express Buttons section of the Checkout page', 'mollie-payments-for-woocommerce'), + 'type' => 'checkbox', + 'default' => 'no', + ], ]; return array_merge($generalFormFields, $paymentMethodFormFieds); }