I need to put a captcha on the product review feature to prevent spams. Unfortunately it doesn't work. The captcha doesn't appear on the page, even if I did the same for the contact page and it works …
Here some sample of my code…
app/design/frontend/default/MyTheme/MyCompany/MyModule/catalog.xml:
<catalog_product_view translate="label">
<reference name="content">
<block type="review/form" name="product.info.review.form" as="info_review_form" template="review/form.phtml">
<block type="core/text_list" name="review.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>review_form</formId></action>
<action method="setImgWidth"><width>230</width></action>
<action method="setImgHeight"><width>50</width></action>
</block>
</block>
</block>
</reference>
</catalog_product_view>
app/code/local/MyCompany/MyModule/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_MyModule>
<version>0.0.0.1</version>
</MyCompany_MyModule>
</modules>
<global>
<models>
<myModule>
<class>MyCompany_MyModule_Model</class>
</myModule>
</models>
<events>
<controller_action_predispatch_contacts_index_post>
<observers>
<myModule>
<class>myModule/observer</class>
<method>checkContactForm</method>
</myModule>
</observers>
</controller_action_predispatch_contacts_index_post>
<controller_action_predispatch_udqa_index_post>
<observers>
<myModule>
<class>myModule/observer</class>
<method>checkUdqaForm</method>
</myModule>
</observers>
</controller_action_predispatch_udqa_index_post>
<controller_action_predispatch_review_product_post>
<observers>
<myModule>
<class>myModule/observer</class>
<method>checkProductReviewForm</method>
</myModule>
</observers>
</controller_action_predispatch_review_product_post>
</events>
</global>
<default>
<captcha>
<frontend>
<areas>
<contacts>
<label>Contacts Page</label>
</contacts>
<udqa_question_form>
<label>Vendor Ask a Question</label>
</udqa_question_form>
<review_form>
<label>Product Review</label>
</review_form>
</areas>
</frontend>
</captcha>
<customer>
<captcha>
<always_for>
<contacts>1</contacts>
<udqa_question_form>1</udqa_question_form>
<review_form>1</review_form>
</always_for>
</captcha>
</customer>
</default>
</config>
My module is enabled in app/etc/modules/MyCompany_MyModule.xml
I've of course created the method checkProductReviewForm
in the app/code/local/MyCompany/MyModule/Model/Observer.php
Please do NOT tell me to install a plugin like "Product Review reCaptcha" as I would like to use the core feature of Magento to do that, thank you.
Edit1: add bold on the last sentence to prevent other comments like Amit Bera's.
Best Answer
I close this question as no answers are provided. I've removed the product reviews for now, as I'll probably use an external tool.