Requirement:
This document summarizes the Recaptcha implementation in webforms extension in the Magento(1.9) website. The Recaptcha implementation in webforms to prevent unauthorized form submission on the Magento(1.9) website.
Solution:
To implement the Recaptcha on the forms in Magento1.9 follow the below-mentioned steps
1. Go to Magento backend system->configuration->customer->customer configuration->captcha enable recaptcha on backend
2. Integrate the Recaptcha templates on the form through page XML layout.
Ex code:
<contacts_index_index>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="right">
<block type="cms/block" name="contact.info">
<action method="setBlockId"><block_id>contact_info</block_id></action>
</block>
</reference>
<reference name="customerForm">
<block type="core/text_list" name="form.additional.info">
<block type="captcha/captcha" name="captcha">
<reference name="head">
<action method="addJs"><file>mage/captcha.js</file> </action>
</reference>
<action method="setFormId"><formId>contacts</formId></action>
<action method="setImgWidth"><width>230</width></action>
<action method="setImgHeight"><width>50</width></action>
</block>
</block>
</reference>
</contacts_index_index>
Thank you.