0

I am creating captcha for product review form. For that I have faced two problem.

First I tried to rewrite post action url, using this code in config.xml.

<rewrite>
            <namespace_module>
                <from><![CDATA[#^/review/product/post/#]]></from>
                <to>/module/review/post/</to>
            </namespace_module>
</rewrite>

this code is not working. when I submit form it redirect me to homepage.

Second issue is that, I am trying to add block on just above submit button using this code.

in base/default/layout/namespace_module.xml

<review_product_list>
        <block name="product.review.form" >
            <block type="core/template" name="custom_block" template="namespace/module/form.phtml"/>
        </block>
</review_product_list>

in base/default/template/review/form.phtml

echo $this->getChildHtml('custom_block'); 

This code is also not working. Do you have idea what I am missing?

0

In the layout XML, the alias (as="...") is missing, which is necessary to reference the block with getChildHtml():

<block type="core/template" name="custom_block"
    template="namespace/module/form.phtml" as="custom_block" />

The rewrite syntax for controllers is very outdated and should not be used anymore, even in Magento 1.6.

For rewriting controllers or adding functionality, see: Trying to override a controller

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.