I am currently considering archiving this module, as I no longer have the free time to continue supporting this code. as per ticket: #43, it seems there are issues in checkout with the validation of the invisible recapctha, which could be related to the usage of prototype 1.7.1
I simply don't have the time due to paid work with deadlines to work on this at present.
If you are using this module, I suggest looking for an alternative, or fork this and continue with it as a seperate project
Drop-In Replacement of OpenMage core Captcha system with Googles reCaptcha
http://www.proxiblue.com.au/blog/magento-recaptcha/
Supports all native OpenMage captcha areas
Supports placing captcha into
Supports Invisible reCaptcha (now the default) with option to set badge position
Supports the 'I am not a robot' reCaptcha (just in case you don't want invisible)
ATTENTION:
Since 17/06/2021 google changed their invisible recaptcha code, which makes it incompatibile with the core version of prototype 1.7.0 which ships with vanilla magento 1. (ref: https://github.com/ProxiBlue/reCaptcha/issues/56 ) This module has been adjusted to include prototype 1.7.1 as of version 2.5.1 (least compatible version required to fix issue) - Thank you to @empiricompany for this fix. You can see the adjsuted code in PR: https://github.com/ProxiBlue/reCaptcha/pull/57
OpenMage 19.4.12 (or the 20.x range) already ships with an updated version of Prototype. You should really be sporting that update on a live site.
ADMIN LOGIN NEEDS MANUAL INTERVENTION
Core magento hardcoded the inclusion of the default prototype 1.7.0 in the following admin files:
app/design/adminhtml/default/default/template/resetforgottenpassword.phtml
app/design/adminhtml/default/default/template/login.phtml
app/design/adminhtml/default/default/template/forgotpassword.phtml
You need to manually adjust these files to change the line:
<script type="text/javascript" src="https://github.com/ProxiBlue/reCaptcha/raw/master/<?php echo $this->getJsUrl('prototype/prototype.js') ?>"></script>
to
<script type="text/javascript" src="https://github.com/ProxiBlue/reCaptcha/raw/master/<?php echo $this->getJsUrl('proxiblue/recaptcha/prototype.js') ?>"></script>
There is no clean fix for this.
Alternatively you can disable admin login reCapctha (and secure your admin via 2fa and firewall access) OR you can simply replace the core prototype file with an updated version of 1.7.1 (ie copy the prodiblue version over the core version, and use that)
If you have magento 1.9.4, OR you have Magento < 1.9.4 + SUPEE 10975 patch installed, you must use release 2.1.x or greater. If you have Magento < 1.9.4 and not pacthed with SUPEE 10975, then you must use version 2.0.1 (the most up-to-date version prior to 1.9.4 and SUPEE 10975 patch) If you have OpenMage use release 2.1.x or greater.
Your should patch to SUPEE 10975 else your store is a security risk!
disable compilation (mageno 1 only, OpenMage have removed the compilation feature)
Update the following to sections in your composer file:
"require": {
"proxiblue/recaptcha": "*"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ProxiBlue/reCaptcha.git"
}
],
composer update
In the root of your OpenMage install, run the following commands:
composer config repositories.github.repo.repman.io composer https://github.repo.repman.io
This should not happen, but if you uninstall the module, you could run into an error that the recaptcha block is not available
exception 'Mage_Core_Exception' with message 'Invalid block type: ProxiBlue_ReCaptcha_Block_Captcha_Recaptcha'
You need to remove two entries from the core table core_config_data
(one for admin, one for frontend)
``DELETE FROM
core_config_dataWHERE
path` = 'customer/capctha/type';``DELETE FROM
core_config_dataWHERE
path` = 'admin/capctha/type';var/cache
folderif you use n98-magerun:
You can get testing/developer keys here: https://developers.google.com/recaptcha/docs/faq
Since 1.4.0 all v1 captcha (pre I am not a Robot) has been removed.
From 1.4.0 you can add the class 'enable-captcha-clicked' to any element and add the 'disabled' property to that element. After clicked, the element will be enabled.
example:
<button type="submit" class="btn btn-primary enable-captcha-clicked" disabled="disabled">Submit</button>
Captcha was disabled in the RWD theme that magento 1.9 uses.
This was done by simply placing an empty layout xml file into the theme.
To make captcha work in magento 1.9:
Place a copy of the base captcha.xml file into your own theme layout folder.
cp app/design/frontend/base/default/layout/captcha.xml app/design/frontend/YOUR_PACKAGE/THEME/layout/captcha.xml
or, delete that file from the rwd theme to fallback to base,
rm app/design/frontend/rwd/default/layout/captcha.xml
Unfortunately the core contact us form does not have before or after form elements block, so you will need to adjust your contact us form to display the capctha.
Edit the contact form located here:
app/design/frontend/[rwd|base|your package]/[default|your theme]/template/contacts/form.phtml
place the following line into the form, anywhere between <ul class="form-list">
and closing <ul>
elements in the form
<?php echo $this->getChildHtml('recaptcha'); ?>
Unfortunately magento core templates do not accommodate reloading the posted form data. This means that if the captcha was incorrect, the user will be given a new blank form. Obviously not ideal.
The captcha extension places the form data into the customer session, aptly named 'formData', using the following lines of code
$data = $controller->getRequest()->getPost();
Mage::getSingleton('customer/session')->setFormData($data);
You can re-populate the form data using the information stored in the session. This will require you to make some changes to the form.phtml file. It is really up to you how you will retrieve and use the session data. As an example, you can do this at the top of the template form.phtml:
$formData = new Varien_Object();
$formData->setData(Mage::getSingleton('customer/session')->getFormData());
The posted data is now held in the Varien Object called $formData You can pre-populate the data as such:
$_firstname = ($formData->getFirstname())?$formData->getFirstname():$this->helper('contacts')->getFirstName();
$_lastname = ($formData->getLastname())?$formData->getLastname():$this->helper('contacts')->getLastName();
$_email = ($formData->getEmail())?$formData->getEmail():$this->helper('contacts')->getEmail();
$_telephone = ($formData->getTelephone())?$formData->getTelephone():'';
$_suburb = ($formData->getSuburb())?$formData->getSuburb():'';
$_postcode = ($formData->getPostcode())?$formData->getPostcode():'';
$_comment = ($formData->getComment())?$formData->getComment():'';
and in the template, simply echo out the values held in the definded variables: An example is as such:
<input name="firstname" id="firstname" title="<?php echo Mage::helper('contacts')->__('First Name') ?>" value="<?php echo $this->htmlEscape($_firstname) ?>" class="input-text required-entry" type="text" />
From version 1.3.0, you can pass two additional params via an AJAX submitted form. The response form the module will then be a JSON string denoting if the captcha failed.
Example AJAX call to submit a contact us form:
$j.ajax({
url: $j('#contactForm').attr('action'),
type: 'POST',
data: {
help: $j("#help").val(),
firstname: $j("#firstname").val(),
lastname: $j("#lastname").val(),
email: $j("#email-address").val(),
telephone: $j("#telephone").val(),
suburb: $j("#suburb").val(),
postcode: $j("#postcode").val(),
comment: $j("#comment").val(),
about: $j("#about").val(),
consultant: $j("#consultant").val(),
json: 1,
gcr: $j("#g-recaptcha-response").val()
},
success: function (result, xhr) {
try {
var result = jQuery.parseJSON(result);
} catch (err) {
// fail silently as result was not JSON, so could be success
}
if(typeof result =='object') {
if (result.error) {
alert(result.error);
}
} else {
// assume a success as not capctha error
// deal with any other form errors here.
}
},
error: function (xhr, err) {
alert(err);
}
});
event.preventDefault();
return false;
Note the inclusion of two extra variables in the POST:
json: 1,
gcr: $j("#g-recaptcha-response").val()
Selecting 'Checkout as Guest' or 'Register at checkout' no longer has a ny difference in the outcome of checkout reCaptcha If EITHER is selected, you will have an active reCapctha at the BILLING section. This is due to how invisible reCacptha works on the page, and I currently see no need to make this work individually
You can Place the Contact Us form within a CMS page using the following Block notation:
<ul>
{{block type="proxiblue_recaptcha/contact" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}
</ul>
Remember to add the custom block to your allowed blocks in System->Permissions->Blocks. Use proxiblue_recaptcha/contact
Unfortunately the core product review form does not have an after form elements block, so you will need to adjust your reviews form to display the captcha.
Edit the reviews form located here:
app/design/frontend/[rwd|base|your package]/[default|your theme]/template/review/form.phtml
place the following line into the form, anywhere between the form elements.
The core functionality can easily be used to produce spam. The process is that an account is created, then a product is added, then spam is generated via the share functionality, with spam messages in the message field. Adding reCaptcha allows you to block this.
Magento introduced wishlist capctha from 1.9.4, or with SUPEE 10975
The custom wishlist recaptcha code of this module was removed, favouring the core functionality. If you require wishlist recapctha in pre 1.9.4 without SUPEE-10975, install version 2.0.1
Magento introduced capctha from 1.9.4, or with SUPEE 10975
The custom recaptcha code of this module was removed, favouring the core functionality. If you require recapctha in pre 1.9.4 without SUPEE-10975, install version 2.0.1
Most sites have newsletter subscribe option, on every page. This is a big source for spam. With invisible recaptcha option you can limit this now, without adding extra effort for user to subscribe.
To make reCaptcha appear on subscriber form/page, you need to edit this template:
app/design/frontend/[rwd|base|your package]/[default|your theme]/template/newsletter/subscribe.phtml
Place the following code between the <form>
and closing </form>
elements:
<ul>
<?php echo $this->getChildHtml('recaptcha'); ?>
</ul>
Ensure options are set in admin to allow recaptcha for newsletter, and using Invisible reCaptcha is recommeded
You can Place the Newsletter Subscription form within a CMS page using the following Block notation:
{{block type="proxiblue_recaptcha/subscribe" template="newsletter/subscribe.phtml"}
Remember to add the custom block to your allowed blocks in System->Permissions->Blocks. Use proxiblue_recaptcha/subscribe
Some possibilities:
To fix this, simply copy the file
app/design/frontend/base/default/layout/proxiblue_recaptcha.xml
to your package or theme folder, which will be located something like such:
app/design/frontend/<PACKAGE_NAME>/<THEME NAME>/layout/proxiblue_recaptcha.xml
There can be quite a few ways that your custom theme/package changed this. The most common would be in your local.xml file, located at app/design/frontend/<PACKAGE_NAME>/<THEME NAME>/layout/local.xml
In that file, locate the relevant sections as noted in the reCaptcha layout file (https://github.com/ProxiBlue/reCaptcha/blob/master/app/design/frontend/base/default/layout/proxiblue_recaptcha.xml)
Insert into the layout sections the relevant reCaptcha parts.
For example, if you have this section in your lcoal.xml file
<review_product_list>
</review_product_list>
copy the entire section from the reCaptcha layout over into that section.
<reference name="product.review.form">
<block type="captcha/captcha" name="recaptcha">
<action method="setFormId">
<formId>user_review</formId>
</action>
<action method="setImgWidth">
<width>230</width>
</action>
<action method="setImgHeight">
<width>50</width>
</action>
</block>
</reference>
</review_product_list>
If, you also have the following: <reference name="product.review.form">
then only copy the BLOCK definition part into that reference.
Run this SQL against your db: DELETE FROM core_config_data where path like '%captcha%'
This will also wipe your api keys, so you will need to re-setup admin.
This is NOT caused by the recapctha module/code, and is a core bug
You are running version <= 2.0.1 on a more up-to-date version of core. Upgrade the module past 2.0.1
You need to clear out the old admin config, and resetup the required forms:
delete from core_config_data where path = 'customer/captcha/forms';
delete from core_config_data where path = 'admin/captcha/forms';
Magento Dynamic Category Products Automate Category Product associations - assign any product to a category, using various rules.