From 713d5bdda15f98251c748793321d465378791652 Mon Sep 17 00:00:00 2001 From: David Remer Date: Fri, 10 Jul 2020 10:27:03 +0300 Subject: [PATCH] PCP-21 / add option for button label --- .../ppcp-button/src/Assets/SmartButton.php | 2 +- modules.local/ppcp-wc-gateway/services.php | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/modules.local/ppcp-button/src/Assets/SmartButton.php b/modules.local/ppcp-button/src/Assets/SmartButton.php index 7a6e6831f..e72f21110 100644 --- a/modules.local/ppcp-button/src/Assets/SmartButton.php +++ b/modules.local/ppcp-button/src/Assets/SmartButton.php @@ -229,7 +229,7 @@ class SmartButton implements SmartButtonInterface 'layout' => 'vertical', 'color' => ($this->settings->has('button_color')) ? $this->settings->get('button_color') : null, 'shape' => ($this->settings->has('button_shape')) ? $this->settings->get('button_shape') : null, - 'label' => 'paypal', + 'label' => ($this->settings->has('button_label')) ? $this->settings->get('button_label') : 'paypal', ], ], 'hosted_fields' => [ diff --git a/modules.local/ppcp-wc-gateway/services.php b/modules.local/ppcp-wc-gateway/services.php index b923b8055..aa99000e5 100644 --- a/modules.local/ppcp-wc-gateway/services.php +++ b/modules.local/ppcp-wc-gateway/services.php @@ -249,6 +249,27 @@ return [ State::STATE_ONBOARDED, ], ], + 'button_label' => [ + 'title' => __('Button Label', 'woocommerce-paypal-commerce-gateway'), + 'type' => 'select', + 'class' => ['wc-enhanced-select'], + 'default' => 'paypal', + 'desc_tip' => true, + 'description' => __( + 'This controls the label on the primary button.', + 'woocommerce-paypal-commerce-gateway' + ), + 'options' => [ + 'paypal' => __('PayPal', 'woocommerce-paypal-commerce-gateway'), + 'checkout' => __('PayPal Checkout', 'woocommerce-paypal-commerce-gateway'), + 'buynow' => __('PayPal Buy Now', 'woocommerce-paypal-commerce-gateway'), + 'pay' => __('Pay with PayPal', 'woocommerce-paypal-commerce-gateway'), + ], + 'screens' => [ + State::STATE_PROGRESSIVE, + State::STATE_ONBOARDED, + ], + ], 'button_color' => [ 'title' => __('Color', 'woocommerce-paypal-commerce-gateway'), 'type' => 'select',