Magento--How to display the comments to the product page

Source: Internet
Author: User
Tags comments wrapper

Magento The default comment fill and display are need to click from the product page to another page, how to submit a comment form and comments to the product page is also an old question, I believe many people know how to operate, but also often have just contact Magento people mentioned this problem, Describe the process today (take 1.4.1.1 as an example).

Open/app/design/frontend/default/your_theme/layout/review.xml and copy the following code

<block type= "Page/html_pager" name= "Product_review_list.toolbar"/> <block type= "core/template" Name= " Product_review_list.count "template=" review/product/view/count.phtml "/> <block type=" Review/product_view_ List "name=" Product.info.product_additional_data "as=" Product_additional_data "template=" review/product/view/ List.phtml "> <block type=" review/form "name=" Product.review.form "as=" Review_form "> <block type=" page/ Html_wrapper "Name=" Product.review.form.fields.before "as=" Form_fields_before "> <action method=" Setmaybeinvisible "><value>1</value></action> </block> </block> </block>

Open/app/design/frontend/default/your_theme/layout/catalog.xml and find

<!--

Product View

-

Paste the code you just copied to

<block type= "Catalog/product_view" name= "Product.info" template= "catalog/product/view.phtml" >

This block inside, because Product_additional_data this block name is already used in the product page, so in order to avoid the conflict I change the comment of this block as Product_review

<block type= "Catalog/product_view" name= "Product.info.options.wrapper.bottom" as= "Product_options_wrapper_ Bottom "template=" catalog/product/view/options/wrapper/bottom.phtml "translate=" label "> <label>bottom Block Options wrapper</label> <action method= "Insert" ><block>product.tierprices</block> </action> <block type= "Catalog/product_view" name= "product.clone_prices" as= "Prices" template= "catalog/ Product/view/price_clone.phtml "/> <action method=" append "><block>product.info.addtocart</block ></action> </block> <!--Alex--<block type= "Page/html_pager" Name= "Product_review_ List.toolbar "/> <block type=" core/template "name=" Product_review_list.count "template=" review/product/view/ Count.phtml "/> <block type=" review/product_view_list "name=" Product.info.product_additional_data "as=" Product_review "template=" review/product/view/list.phtml "> <block type=" review/form "Name=" product.review.fORM "as=" Review_form "> <block type=" page/html_wrapper "name=" Product.review.form.fields.before "as=" form_ Fields_before "> <action method=" setmaybeinvisible "><value>1</value></action> </ Block> </block> </block> <!--Alex--<block type= "Core/template_facade" Name= " Product.info.container1 "as=" Container1 "> <action method=" Setdatabykey "><key>alias_in_layout</ key><value>container1</value></action> <action method= "SetDataByKeyFromRegistry" >< Key>options_container</key><key_in_registry>product</key_in_registry></action> < Action method= "append" ><block>product.info.options.wrapper</block></action> <action method= "Append" ><block>product.info.options.wrapper.bottom</block></action> </block>  

The last step, open the/app/design/frontend/default/your_theme/template/catalog/product/view.phtml, call the block at the appropriate location, I now add it to the last side

<?php echo $this->getchildhtml (' upsell_products ')?> <?php echo $this->getchildhtml (' product_ Additional_data ')?> <!--Alex--and <?php echo $this->getchildhtml (' Product_review ')?> <!--Alex-- >

Complete, the cache is open, remember to refresh the cache. The effect is as follows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.