Last active
May 22, 2017 12:42
-
-
Save cubehrends/a7728411a943dcd100b484812b112c9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var $select = $('#wc_checkout_add_ons_1'); | |
$select.change(function () { | |
if ( $(this).val() == 'none' ) { | |
hideFields(); | |
} else { | |
showFields(); | |
} | |
}); | |
function showFields() { | |
$('#wc_checkout_add_ons_2_field').show(); | |
$('#wc_checkout_add_ons_3_field').show(); | |
} | |
function hideFields() { | |
$('#wc_checkout_add_ons_2_field').hide(); | |
$('#wc_checkout_add_ons_3_field').hide(); | |
} | |
$select.val() == 'none' ? hideFields() : showFields(); | |
} )( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment