To show Product details and add to cart link at the end of product view page i have created a new block like follows, in local.xml file i have added following lines

    <reference name="content">
        <block type="page/html" name="product_footer" template="productblock/productfooter.phtml">
            <block type="catalog/product_footer_view" name="product.info.view" as="footer.view" template="catalog/product/footer_view.phtml">
                <block type="catalog/product_view" name="product.info.addtocart" as="addtocart_footer" template="catalog/product/view/addtocart_footer.phtml"/>
                <block type="catalog/product_view" name="product.info.media" as="media_footer" template="catalog/product/view/media_footer.phtml"/>

and created productfooter.phtml with <?php echo $this->getChildHtml('footer_view'); ?>.And also duplicated view.phtml,media.phtml,addtocart.phtml. Now the block is there in my product view page but the footer_view.phtml is not displaying anything.Please help me to find the mistake in my code.


You could make something like

<catalog_product_view> <reference name="content"> <block type="page/html" name="product_footer" template="productblock/productfooter.phtml"> <block type="catalog/product_view" name="product.info.addtocart.footer" as="addtocart.footer" template="catalog/product/view/addtocart-footer.phtml"/> </block> </reference> </catalog_product_view>

then duplicate addtocart.phtml and rename it to addtocart-footer.phtml. Add

<?php echo $this->getChildHtml('addtocart.footer'); ?>

inside productfooter.phtml.

I haven't tested but i am suspecting that the only reason that wouldn't work is that you have to examine the product view page and see how the forms are constructed and where you should put the second add to cart button. Not sure thought. Test it.

Cheers. :)

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.