Skip to content

Commit

Permalink
Merge pull request #1387 from angelleye/PFW-517
Browse files Browse the repository at this point in the history
Hide all smart button option when Enable Smart Buttons is disable, PF…
  • Loading branch information
kcppdevelopers committed Nov 5, 2019
2 parents fbdf420 + 0aea9ad commit a791a07
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion assets/js/angelleye-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ jQuery(document).ready(function ($) {
jQuery('woocommerce_paypal_express_enable_google_analytics_click').closest('tr').hide();
jQuery('#woocommerce_paypal_express_checkout_with_pp_button_type').closest('tr').hide();
jQuery('.angelleye_smart_button_setting_left').show();
jQuery('.in_context_checkout_part').show();
jQuery('.in_context_checkout_part').next('p').show();
jQuery('.in_context_checkout_part').parents('table').show();
} else {
jQuery('.display_smart_button_previews').hide();
jQuery('.angelleye_button_settings_selector').hide();
jQuery('#woocommerce_paypal_express_show_paypal_credit').closest('tr').show();
jQuery('#woocommerce_paypal_express_checkout_with_pp_button_type').closest('tr').show();
jQuery('.angelleye_smart_button_setting_left').hide();
jQuery('woocommerce_paypal_express_enable_google_analytics_click').closest('tr').show();

jQuery('.in_context_checkout_part').hide();
jQuery('.in_context_checkout_part').next('p').hide();
jQuery('.in_context_checkout_part').parents('table').hide();

}
}).change();
$("#woocommerce_paypal_express_customer_service_number").attr("maxlength", "16");
Expand Down
13 changes: 13 additions & 0 deletions classes/wc-gateway-paypal-express-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,7 @@ public function init_form_fields() {
),
'enable_google_analytics_click' => array(
'title' => __('Google Analytics', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __('Enable Google Analytics Click Tracking.'),
'default' => 'no'
Expand All @@ -1266,11 +1267,13 @@ public function init_form_fields() {
),
'single_product_button_settings' => array(
'title' => __('Single Product Button Settings', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'description' => __( 'Enable the Product specific button settings, and the options set will be applied to the PayPal buttons on your Product pages.', 'paypal-for-woocommerce' ),
'type' => 'title'
),
'single_product_configure_settings' => array(
'title' => __('Enable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Configure settings specific to Single Product pages.', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand Down Expand Up @@ -1314,11 +1317,13 @@ public function init_form_fields() {
),
'cart_button_settings' => array(
'title' => __('Cart Button Settings', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'description' => __( 'Enable the Cart specific button settings, and the options set will be applied to the PayPal buttons on your shopping cart page.', 'paypal-for-woocommerce' ),
'type' => 'title'
),
'cart_configure_settings' => array(
'title' => __('Enable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Configure settings specific to the Cart page.', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand Down Expand Up @@ -1362,11 +1367,13 @@ public function init_form_fields() {
),
'mini_cart_button_settings' => array(
'title' => __('Mini-cart Button Settings', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'description' => __( 'Enable the Mini-Cart specific button settings, and the options set will be applied to the PayPal buttons on your mini-cart.', 'paypal-for-woocommerce' ),
'type' => 'title'
),
'mini_cart_configure_settings' => array(
'title' => __('Enable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Configure settings specific to the mini-cart display.', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand Down Expand Up @@ -1410,11 +1417,13 @@ public function init_form_fields() {
),
'checkout_page_button_settings' => array(
'title' => __('Checkout Page Button Settings', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'description' => __( 'Enable the Checkout Page specific button settings, and the options set will be applied to the PayPal buttons on your Checkout page.', 'paypal-for-woocommerce' ),
'type' => 'title'
),
'checkout_page_configure_settings' => array(
'title' => __('Enable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Configure settings specific to the Checkout page.', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand All @@ -1423,6 +1432,7 @@ public function init_form_fields() {
),
'checkout_page_disable_smart_button' => array(
'title' => __('Enable/Disable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Disable smart buttons in the regular list of payment gateways.', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand Down Expand Up @@ -1468,11 +1478,13 @@ public function init_form_fields() {
if (defined('XOO_WSC_PATH')) {
$this->form_fields['wsc_cart_button_settings'] = array(
'title' => __('Woo Side Cart Button Settings', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'description' => __( 'Enable the Woo Side Cart specific button settings, and the options set will be applied to the PayPal buttons on your Woo Side Cart.', 'paypal-for-woocommerce' ),
'type' => 'title'
);
$this->form_fields['wsc_cart_configure_settings'] = array(
'title' => __('Enable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Configure settings specific to the Woo Side Cart display.', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand All @@ -1481,6 +1493,7 @@ public function init_form_fields() {
);
$this->form_fields['wsc_cart_disable_smart_button'] = array(
'title' => __('Enable/Disable', 'paypal-for-woocommerce'),
'class' => 'in_context_checkout_part',
'type' => 'checkbox',
'label' => __( 'Disable the buttons in the Woo Side Cart', 'paypal-for-woocommerce' ),
'default' => 'no',
Expand Down

0 comments on commit a791a07

Please sign in to comment.