0

If I want to display my template file AFTER the "Add to Cart" button on every product view page, but it gets displayed at the bottom of page content?

<layout>
    <catalog_product_view>
        <reference name="content">
            <block type="test_example/example" name="product.example" after="product.info.addtocart" template="test/example/view.phtml"/>
        </reference>
    </catalog_product_view>
</layout>

I have tried many different after="product.info.addtocart" by searching for layout block names in files, but everything gets displayed at the bottom of page content no matter what.

2 Answers 2

2

You can directly add your template file to product.info.addtocart block.

<layout>
    <catalog_product_view>
        <reference name="product.info.addtocart">
            <block type="test_example/example" after="-" name="product.example" template="test/example/view.phtml"/>
        </reference>
    </catalog_product_view>
</layout>
0
0

go to app/design/frontend/YourPackage/YourTheme/template/catalog/product/view/addtocart.phtml

and below code after addtocart button

<?php echo $this->getLayout()->createBlock('test_example/example')->setTemplate('test/example/view.phtml')->toHtml(); ?>

Your Answer

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

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