Plugin Directory

Changeset 3340368


Ignore:
Timestamp:
08/06/2025 12:37:16 PM (8 months ago)
Author:
bitsstech
Message:

fixes

Location:
otpfy-your-website/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • otpfy-your-website/trunk/otpfy-for-wordpress.php

    r3340312 r3340368  
    1212 * Plugin URI:        https://otpfy.in
    1313 * Description:       OTPfy almost anything in your wordpress website!! OTP based Login, Signup, Order Confirmation, just anything you can imagine. Integrate OTP based 2 factor authentication using our developer hooks.
    14  * Version:           1.0.3
     14 * Version:           1.0.3.2
    1515 * Author:            Bitss Techniques
    1616 * Author URI:        https://bitss.tech
     
    3131 * Rename this for your plugin and update it as you release new versions.
    3232 */
    33 define( 'OTPFY_FOR_WORDPRESS_VERSION', '1.0.3' );
     33define( 'OTPFY_FOR_WORDPRESS_VERSION', '1.0.3.2' );
    3434
    3535/**
  • otpfy-your-website/trunk/public/class-otpfy-for-wordpress-public.php

    r3340312 r3340368  
    464464
    465465    function woocommerce_checkout_process(){
    466          if (is_user_logged_in()) {
     466        $get_checkout_verify = $this->settings->get_checkout_verify();
     467        if($get_checkout_verify == "off") return;
     468        if($get_checkout_verify == "cod" && !isset($_POST['payment_method']) && !isset($_POST['payment_method_cod'])){
     469            return; // Skip OTP for non-COD payments
     470        }
     471        if (is_user_logged_in()) {
    467472            $is_verified = get_user_meta(get_current_user_id(), '_otp_verified', true);
    468473        } else {
  • otpfy-your-website/trunk/public/js/otpfy-checkout.js

    r3340312 r3340368  
    6262
    6363    // WooCommerce JS hook:
    64     $('form.checkout').on('checkout_place_order', function() {
     64    //$('form.checkout').on('checkout_place_order', function(e) {
     65    $(document).on('click', '#place_order', function(e) {
    6566        if (otpVerified) return true;
    6667        if(otpfy_checkout_params.checkout_verify == "off") return true;
     
    6970        }
    7071        sendOTP();
     72        e.preventDefault(); // Prevent form submission
     73        e.stopImmediatePropagation();
    7174        return false; // Always block until verified!
    7275    });
     
    7578        if (otpVerified) return true; // Skip if already verified
    7679        let mobile = $('#billing_phone').val();
     80        if (!mobile) {
     81            mobile = $('#shipping_phone').val();
     82        }
    7783        $('.otpfy-otp-form-resend').hide();
    7884        if (!mobile) {
     
    117123        }
    118124        let mobile = $('#billing_phone').val();
     125        if (!mobile) {
     126            mobile = $('#shipping_phone').val();
     127        }
    119128        $('#otp-msg').text('Verifying...');
    120129        $.post(otpfy_checkout_params.ajax_url, {
Note: See TracChangeset for help on using the changeset viewer.