Created
November 6, 2017 09:01
-
-
Save kreamweb/01de15850e11970f4964a9a85e95e4fd to your computer and use it in GitHub Desktop.
if points inserted ad more tha max
This file contains hidden or 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 | |
if ( defined( 'YITH_YWPAR_PREMIUM' ) ) { | |
function ywpar_print_my_inline_script() { | |
?> | |
<script type="text/javascript" charset="utf-8"> | |
jQuery(document).find('form.ywpar_apply_discounts').on('submit', function (e) { | |
var max = jQuery('input[name="ywpar_points_max"]').val(), | |
input_t = jQuery('#ywpar-points-max').val(); | |
if (parseInt(max) < parseInt(input_t)) { | |
alert('your message'); | |
return false; | |
} else { | |
return true; | |
} | |
}); | |
</script> | |
<?php | |
endif; | |
} | |
add_action( 'wp_footer', 'ywpar_print_my_inline_script', 99 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment