Home › Forums › WooWallet Coupons › URGENT: Users are able to get 2x the amount when clicking “Redeem coupon” › Reply To: URGENT: Users are able to get 2x the amount when clicking “Redeem coupon”
My website is live and has sensitive codes so i couldnt wait up since i already integrated this, thanks a bunch for the tip about the bug and here is how i temporary solved it.
Using your original code i added
THEMEFOLDER/js/doubclick.js
jQuery(function(doubleclick) {
$(“form”).submit(function() {
// submit more than once return false
$(this).submit(function() {
return false;
});
// submit once return true
return true;
});
});
Theme FUNCTIONS.PHP added before end
add_action( ‘wp_enqueue_scripts’, ‘add_my_script’ );
function add_my_script() {
wp_enqueue_script(
‘doubleclick’, // name your script so that you can attach other scripts and de-register, etc.
get_template_directory_uri() . ‘/js/doubleclick.js’, // this is the location of your script file
array(‘jquery’) // this array lists the scripts upon which your script depends
);
}