Created
July 9, 2014 17:20
-
-
Save lorenzocaum/6683b64ea28589a1afc6 to your computer and use it in GitHub Desktop.
Remove zero option from MER in Event Espresso 3 and select 1 by default
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
<?php | |
//* Do NOT include the opening php tag | |
//* Remove the zero option in dropdown and set default to 1 | |
function ee_remove_zero_from_dropdown() { | |
?> | |
<script>jQuery(document).ready(function(){ | |
jQuery(".price_id").val(1); | |
jQuery('#event_espresso_refresh_total').trigger('click'); | |
}); | |
</script> | |
<script> | |
jQuery(document).ready(function () { | |
jQuery(".price_id option[value='0']").remove(); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'ee_remove_zero_from_dropdown' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment