0

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

<catalog_product_view> <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"/> </block> </block> </reference> </catalog_product_view> 

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.

1 Answer 1

1

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. :)

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.