| 1 |
// * ----- Disable Enforce Login based on Guest Checkout Setting ----- * // |
| 2 |
jQuery(document).ready(($) => { |
| 3 |
const guestCheckout = $("#wp_subscription_allow_guest_checkout"); |
| 4 |
const enforceLogin = $("#wp_subscription_enforce_login"); |
| 5 |
|
| 6 |
function toggleEnforceLogin() { |
| 7 |
enforceLogin.prop("disabled", !guestCheckout.is(":checked")); |
| 8 |
} |
| 9 |
|
| 10 |
// Initial state |
| 11 |
toggleEnforceLogin(); |
| 12 |
|
| 13 |
// On change |
| 14 |
guestCheckout.on("change", toggleEnforceLogin); |
| 15 |
}); |
| 16 |
// * ----- Disable Enforce Login based on Guest Checkout Setting ----- * // |
| 17 |
|