Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter acn

    (@acseven)

    I’ve solved this temporarily with a code snippet, although it would be better to have above the Place Order button:

    add_action ('woocommerce_checkout_after_order_review', 'fix_captcha_order');
    
    function fix_captcha_order () {
      if ( function_exists ( 'anr_captcha_form_field' ) ) {
    
    	echo '<div class="form-row place-order right">';
    
    	anr_captcha_form_field();
    
    	echo '</div>';
      }
    }

    Thanks — I had the same problem and this snippet worked for me. In fact, I tried several other recaptcha plugins and they had the same problem with not displaying the recaptcha. So this might have something to do with the way WooCommerce is now displaying the checkout page, not sure.

    Checkout page should not show recaptcha and also should not validate recaptcha. How you end up with validate recaptcha in checkout page? Can you assist me to investigate this issue and fix this plugin?
    This plugin will validate recaptcha during Login, register, lost password and reset password. Is your checkout page containing any of this in background? eg. if login/registration in enabled in checkout page then those will show form, but those form will also have recaptcha. But if it done in background ( eg. auto registration ) then there will be no form and no recaptcha, then that will fail. Can you give me some more info about this?

    Hi Shamim, sorry for the delay, I’ve been out for a couple of days. Thanks for working on the fix. Our situation may be somewhat unique, not sure.

    We use WooCommerce for site registration and Lost Passwords, and the noCaptcha works just fine on those pages.

    We use WooCommerce to sell a subscription, so we bypass the cart page and go right to the checkout page. We also force users to create an account on the checkout page. Because the only way to complete the checkout is by entering a valid credit card, we would prefer to NOT use the Captcha on the checkout page.

    The problem before your update was that the captcha did not appear on the checkout page, but it still threw an error that the captcha was not validated.

    I just tested your latest release and now the problem is different. The captcha now appears on the checkout page regardless whether I have the “WooCommerce Checkout” option checked or not. I *think* the reason is because (as you stated) we force registration on that page as well.

    The good news is I can complete an order. But our preference would be to be able to actually eliminate the captcha from the checkout page altogether, if possible. (Also note it appears in a strange place, below the order button, not above it.)

    Does that help? Let me know if you have more questions.

    WooCommerce checkout page has two separate reason to validate captcha
    1. if checkout registration is enabled and registration captcha is enabled
    2. if checkout captcha is enabled

    so if any of the reason is present then you have to solve captcha. So i have to show capctha to solve that.

    and to position of captcha, there are some hooks those are after submit button ( where is now ) or before payment options. So i think it is better place. i do not have that much time to make a way to show capctha just before submit button. if anybody want to help me just make a pull request in github https://github.com/shamim2883/advanced-nocaptcha-recaptcha

    Shamim,

    I think there’s a way to do this to give admins more control. There’s a hook called ‘woocommerce_register_form’ that appears on the registration page, but not on the checkout page. I *think* this would allow for a third option to your list:

    1) Checkout page with registration
    2) Checkout page without registration
    3) Registration page (only)

    This way I could choose to show the captcha on the registration-only page but not on my checkout page.

    If I disable all the choices in your plugin and add @acn’s code above, using the hook ‘woocommerce_register_form’ the captcha only appears on my register form but not on my checkout page.

    Unfortunately it doesn’t validate the captcha, so I must be missing something in the code.

    WordPress core hook register_form will show captcha in both normal registration form and wc registration form. Also if checkout page registration in enabled it will validate registration as it is a normal wc registration. all hook for wc registration is fired. I do not see any hook that is fired in normal wc registration validation but not fired in checkout page registration validation.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WooCommerce Captcha missing’ is closed to new replies.