ProxiBlue / reCaptcha

Clean implementation of Google reCaptcha for magento
http://www.proxiblue.com.au/blog/magento-recaptcha/
GNU General Public License v3.0
86 stars 61 forks source link

Contacts page with reCaptcha doesn't work embedded in custom cms page #18

Closed r2retail closed 6 years ago

r2retail commented 6 years ago

as title states, I have a working Contacts page with the Recaptcha. works without issues. but If I load the contacts page into a custom cms page in magento, the Recaptcha works, but the Recaptcha won't render, and cannot be completed this way.

ProxiBlue commented 6 years ago

Hi.

Can you give an example on how you are adding the contact us to the CMS page

r2retail commented 6 years ago

hey,

The code used is :

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

ProxiBlue commented 6 years ago

Hi,

with

but the Recaptcha won't render

do you mean that the reCaptcha is not display at all?

r2retail commented 6 years ago

It's not even loaded in the code. example of one of our webshops with issues:

working contacts page: https://www.sheisdifferent.nl/contacts

the code used as mentioned above. for the custom cms page: https://www.sheisdifferent.nl/over-ons

ProxiBlue commented 6 years ago

Here you go: https://github.com/ProxiBlue/reCaptcha#use-in-cms-page

ProxiBlue commented 6 years ago

@r2retail You may close this ticket if you find the issue fixed. Thank you.

r2retail commented 6 years ago

Thank you for the quick reply,

I have updated the module, I have used the new embedded code and added permissions for the custom block. sadly this still doesn't work.

as far as I can notice is that the captcha javascript isn't loaded on the cms page.

I've used it on a different webshop that has the form embedded into a static block, and this works. So This might be a theme problem for the shop mentioned above, I'm still working on it, just wanted to give an update already.

update:

it works like it should be, I have an issue with the theme now on this particularly shop but it fixed it on the other websites, even in cms-page. Thank you very much for the quick update

ProxiBlue commented 6 years ago

No worries.

You may want to consider using an ajax form post, allowing the user to remain on the CMS page when submitting a contact request. You can achieve this easily by making a new template contact/form_ajax.phtml, and use that as the template file when embedding.

Here is a live exmaple: https://www.enjo.com.au/become-an-enjopreneur