diff --git a/modules.local/ppcp-button/src/Assets/SmartButton.php b/modules.local/ppcp-button/src/Assets/SmartButton.php index ef70fd89a..aaaaef3cc 100644 --- a/modules.local/ppcp-button/src/Assets/SmartButton.php +++ b/modules.local/ppcp-button/src/Assets/SmartButton.php @@ -108,8 +108,8 @@ class SmartButton implements SmartButtonInterface 'url' => $smartButtonUrl, 'style' => [ 'layout' => 'vertical', - 'color' => 'gold', - 'shape' => 'rect', + 'color' => $this->settings->get('button_color'), + 'shape' => $this->settings->get('button_shape'), 'label' => 'paypal', ], ], diff --git a/modules.local/ppcp-wc-gateway/src/Settings/SettingsFields.php b/modules.local/ppcp-wc-gateway/src/Settings/SettingsFields.php index b1585b6a2..8b93467c1 100644 --- a/modules.local/ppcp-wc-gateway/src/Settings/SettingsFields.php +++ b/modules.local/ppcp-wc-gateway/src/Settings/SettingsFields.php @@ -99,6 +99,38 @@ class SettingsFields 'label' => __('Enable on Cart', 'woocommerce-paypal-gateway'), 'default' => 'yes', ], + 'button_color' => [ + 'title' => __('Color', 'woocommerce-paypal-gateway'), + 'type' => 'select', + 'class' => 'wc-enhanced-select', + 'default' => 'gold', + 'desc_tip' => true, + 'description' => __( + 'Controls the background color of the primary button. Use "Gold" to leverage PayPal\'s recognition and preference, or change it to match your site design or aesthetic.', + 'woocommerce-paypal-gateway' + ), + 'options' => [ + 'gold' => __('Gold (Recommended)', 'woocommerce-paypal-gateway'), + 'blue' => __('Blue', 'woocommerce-paypal-gateway'), + 'silver' => __('Silver', 'woocommerce-paypal-gateway'), + 'black' => __('Black', 'woocommerce-paypal-gateway'), + ], + ], + 'button_shape' => [ + 'title' => __('Shape', 'woocommerce-paypal-gateway'), + 'type' => 'select', + 'class' => 'wc-enhanced-select', + 'default' => 'rect', + 'desc_tip' => true, + 'description' => __( + 'The pill-shaped button\'s unique and powerful shape signifies PayPal in people\'s minds. Use the rectangular button as an alternative when pill-shaped buttons might pose design challenges.', + 'woocommerce-paypal-gateway' + ), + 'options' => [ + 'pill' => __('Pill', 'woocommerce-paypal-gateway'), + 'rect' => __('Rectangle', 'woocommerce-paypal-gateway'), + ], + ], ]; } }