Jump to content

reCaptcha working for the form and registration but not on the checkout page


afalls

Recommended Posts

Can anyone explain to me why reCaptcha (v2 checkbox) works for the contact form and customer registration pages but won't work on the checkout page? 

It always get this message: The following errors were detected: The verification code was incorrect. Please try again."

I have tried v2 both invisible and checkbox.

You can complete an order if i disable reCaptcha.

Cubecart version 6.4.7
Skin is Basix with CSS customisations (Not working with my previous skin - Foundation either)
website is www.mplastics.com.au

Thanks in advance

Link to comment
Share on other sites

Have you modified the Basix template "content.checkout.php" or any of the other templates used at this stage?

I ask because looking at the source as revealed in my browser's Developer's Tools, I find the HTML that acts as the g-recaptcha area sits outside the one and only <form>...</form> block.

Also not in the <form> block is the Additional Comments text entry field, and everything below it.

So, let's double check how the sub-templates are placed in the main checkout template, specifically finding where the <form> tags are.

 

Link to comment
Share on other sites

No, in this skin i have only made cosmetic changes and moved some of the items around in the header. 

I did engage Cubecart support to do some things for me as i was on limited time to get the site live but they are firm that the issue lies with my hosting and my hosting said the fault is with cubecart. I am trying to exhaust all options as my client doesn't want to change hosting companies - and that is not a move i will make lightly.

In light of what you have said i just checked out the demo for Foundation and Basix and it does look like its completely set up differently for basket and checkout stages. Could there be faults in the Basix template causing this?

Link to comment
Share on other sites

The only fault I have found so far is a mismatch in the hierarchy of the Billing Address area.

					<div class="panel-heading">Billing Address</div>
					<div class="panel-body">
						<div class="row">
							<div class="">
								<dl>...</dl>
								<address>
									<dl>...</dl>
									<div id="address_form">
										<dl>...</dl>
										<div class="row">
											<dl class="col-xs-6">...</dl>
											<dl class="col-xs-6">...</dl>
										</div>
										<div class="row">
											<dl class="col-xs-12 col-sm-6">...</dl>
											<dl class="col-xs-12 col-sm-6" id="state-list_wrapper">...</dl>
										</div>
									</address>
								</div>
							</div>
						</div>
						<div class="well well-sm">
							<input type="checkbox" name="delivery_is_billing" id="delivery_is_billing" checked="checked">
							<label for="delivery_is_billing">Deliver to billing address.</label>
						</div>
					</div>

The </address> and the following </div> need to be swapped.

Normally, the browser is sort of forgiving for situations like this. But experience has shown that an extra or missing <div> tag can cause all sorts of mysterious behavior.

I have the source of the Basix skin template "content.checkout.confirm.php", near lines 282-283. These are the lines that get swapped.

Whether that fixes reCaptcha, I do not know.

After making the skin edit, you may need to clear CubeCart's internal cache.

Edited by bsmither
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...