URGENT: Users are able to get 2x the amount when clicking “Redeem coupon”2020-06-04T08:56:19+05:30

Home Forums WooWallet Coupons URGENT: Users are able to get 2x the amount when clicking “Redeem coupon”

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • albadrtw
    Participant
    Post count: 2

    This is very serious issue. Users are able to get 2x amount by clicking the redeem coupon button twice. Even if coupon is set to 1/1 usage.

    This simple jquery in front-end file solved the issue

    jQuery(function() {
    $(“form”).submit(function() {
    // submit more than once return false
    $(this).submit(function() {
    return false;
    });
    // submit once return true
    return true;
    });
    });

    Mohamad Ghaoui
    Participant
    Post count: 4

    which front end file did you insert this to ? it appears the issue is still the same in their script yet !

    Mohamad Ghaoui
    Participant
    Post count: 4

    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
    );
    }

    Mohamad Ghaoui
    Participant
    Post count: 4

    Another way to prevent this client side is :
    onclick=”this.disabled=true;this.value=’Sending, please wait…’;this.form.submit();” < added simply in the form , frontend file on submit
    but this needs author attention

    Still can be overridden, any advice here ?
    Any support available ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.