0

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?

2 Answers 2

1

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

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

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

<catalog_product_view>
        <block type="<your_class_block>" 
name="<your_name>" 
template="<your_template_file>"/>
</catalog_product_view>

then in your view.phtml you should put:

$this->getChildHtml('<your_name_or_alias_of_block');
0
  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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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