I'm trying to do a form and put this on Product View. I did some fields and they are saving the results on DB, ok, everything is good. But, I need to insert this block there. Any thing that I help me?

New contributor
Rannye Rodrigues is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

In your theme, you should extend catalog.xml and inside him put:

    <reference name="product.info">
        <block type="<your_class_block>" name="<your_name>" template="<your_template_file>"/>

But, if you don't want product.info you can add a block inside <catalog_product_view>

        <block type="<your_class_block>" 

then in your view.phtml you should put:

  1. app/design/frontend/{package}/{themename}/template/catalog/product/view/form /my_custom_form.phtml

    //your form content here
  2. app/design/frontend/{package}/{themename}/layout/local.xml

        <reference name="root">
            <block type="core/template" name="my.custom.form" template="catalog/product/view/form/my_custom_form.phtml"/>
  3. app/design/frontend/{package}/{themename}/template/catalog/product/view.phtml

    <?php echo $this->getBlockHtml("my.custom.form"); ?>

Your Answer

Rannye Rodrigues is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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