PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.2.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.2.0
2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 All 65 releases
subscription / assets / js / gateway_options_toggler.js

gateway_options_toggler.js in Subscriptions for WooCommerce with Stripe Recurring Payments 2.2.0, at assets/js/gateway_options_toggler.js

51 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function () {
2 const paypalTestMode = jQuery("#woocommerce_wp_subscription_paypal_testmode");
3
4 makePaypalTestModeChange();
5 paypalTestMode.change(makePaypalTestModeChange);
6
7 function makePaypalTestModeChange() {
8 if (paypalTestMode.is(":checked")) {
9 // Base
10 jQuery(".wpsubs-paypal-live-creds").hide();
11 jQuery(".wpsubs-paypal-sandbox-creds").show();
12
13 // Titles
14 jQuery(".wc-settings-sub-title.wpsubs-paypal-live-creds").hide();
15 jQuery(".wc-settings-sub-title.wpsubs-paypal-sandbox-creds").show();
16
17 // Input fields
18 jQuery("input.wpsubs-paypal-live-creds").parent().parent().parent().hide();
19 jQuery("input.wpsubs-paypal-sandbox-creds").parent().parent().parent().show();
20
21 // Text areas
22 jQuery("textarea.wpsubs-paypal-live-creds").parent().parent().parent().hide();
23 jQuery("textarea.wpsubs-paypal-sandbox-creds").parent().parent().parent().show();
24
25 // Selects
26 jQuery("select.wpsubs-paypal-live-creds").parent().parent().parent().hide();
27 jQuery("select.wpsubs-paypal-sandbox-creds").parent().parent().parent().show();
28 } else {
29 // Base
30 jQuery(".wpsubs-paypal-live-creds").show();
31 jQuery(".wpsubs-paypal-sandbox-creds").hide();
32
33 // Titles
34 jQuery(".wc-settings-sub-title.wpsubs-paypal-live-creds").show();
35 jQuery(".wc-settings-sub-title.wpsubs-paypal-sandbox-creds").hide();
36
37 // Input fields
38 jQuery("input.wpsubs-paypal-live-creds").parent().parent().parent().show();
39 jQuery("input.wpsubs-paypal-sandbox-creds").parent().parent().parent().hide();
40
41 // Text areas
42 jQuery("textarea.wpsubs-paypal-live-creds").parent().parent().parent().show();
43 jQuery("textarea.wpsubs-paypal-sandbox-creds").parent().parent().parent().hide();
44
45 // Selects
46 jQuery("select.wpsubs-paypal-live-creds").parent().parent().parent().show();
47 jQuery("select.wpsubs-paypal-sandbox-creds").parent().parent().parent().hide();
48 }
49 }
50 });
51