{"id":9843,"date":"2013-03-08T14:52:26","date_gmt":"2013-03-08T09:22:26","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=9843"},"modified":"2013-03-08T14:52:26","modified_gmt":"2013-03-08T09:22:26","slug":"displaying-review-block-with-ratings-on-product-page-in-magento","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/displaying-review-block-with-ratings-on-product-page-in-magento\/","title":{"rendered":"Displaying Review Block (with ratings) On Product Page In Magento"},"content":{"rendered":"<p>\nOne of the most common customization in magento is to display reviews and ratings on the product page itself. This blog will show you how to render reviews and ratings on product page. Following are steps.\n<\/p>\n<p>\nOpen your theme&#8217;s catalog.xml and include the following code inside block type=&#8221;catalog\/product_view&#8221;\n<\/p>\n<p>[php]<br \/>\n&lt;!&#8211; For adding review page on product page &#8211;&gt;<br \/>\n&lt;block type=&quot;catalog\/product_view&quot; name=&quot;product.info.addto&quot; as=&quot;addto&quot; template=&quot;catalog\/product\/view\/addto.phtml&quot;\/&gt;<br \/>\n&lt;block type=&quot;catalog\/product_view&quot; name=&quot;product.info.addtocart&quot; as=&quot;addtocart&quot; template=&quot;catalog\/product\/view\/addtocart.phtml&quot;\/&gt;<br \/>\n&lt;block type=&quot;catalog\/product_view&quot; name=&quot;product.tierprices&quot; as=&quot;tierprices&quot; template=&quot;catalog\/product\/view\/tierprices.phtml&quot;\/&gt;<br \/>\n&lt;block type=&quot;core\/template&quot; name=&quot;product.info.other&quot; as=&quot;other&quot; template=&quot;review\/product\/view\/other.phtml&quot;\/&gt;<br \/>\n&lt;block type=&quot;page\/html_pager&quot; name=&quot;product_review_list.toolbar&quot; \/&gt;<br \/>\n&lt;block type=&quot;core\/template&quot; name=&quot;product_review_list.count&quot; template=&quot;review\/product\/view\/count.phtml&quot; \/&gt;<br \/>\n&lt;block type=&quot;review\/product_view_list&quot; name=&quot;product.info.product_additional_data&quot; as=&quot;product_additional_data&quot; template=&quot;review\/product\/view\/list.phtml&quot;&gt;<br \/>\n&lt;block type=&quot;review\/form&quot; name=&quot;product.review.form&quot; as=&quot;review_form&quot;&gt;<br \/>\n&lt;block type=&quot;page\/html_wrapper&quot; name=&quot;product.review.form.fields.before&quot; as=&quot;form_fields_before&quot;&gt;<br \/>\n&lt;action method=&quot;setMayBeInvisible&quot;&gt;&lt;value&gt;1&lt;\/value&gt;&lt;\/action&gt;<br \/>\n&lt;\/block&gt;<br \/>\n&lt;\/block&gt;<br \/>\n&lt;\/block&gt;<br \/>\n[\/php]<\/p>\n<p>\nAnd then go to &#8220;\\template\\review\\product\\view\\list.phtml&#8221; and add following code in it :\n<\/p>\n<p>[php]<br \/>\n&lt;?php <\/p>\n<p>$reviewUrl = str_replace(&quot;\/catalog\/&quot;, &quot;\/review\/&quot;, $this-&gt;getReviewUrl()); <\/p>\n<p>?&gt;<br \/>\n[\/php]<\/p>\n<p>\nand replace :\n<\/p>\n<p>[php]<br \/>\n&lt;a href=&quot;&lt;?php echo $this-&gt;getReviewUrl($_review-&gt;getId()) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getTitle()) ?&gt;&lt;\/a&gt; &lt;?php echo $this-&gt;__(&#8216;Review by &lt;span&gt;%s&lt;\/span&gt;&#8217;, $this-&gt;htmlEscape($_review-&gt;getNickname())) ?&gt;<br \/>\n[\/php]<\/p>\n<p>\nwith :\n<\/p>\n<p>[php]<br \/>\n&lt;a href=&quot;&lt;?php echo $reviewUrl.&#8217;id\/&#8217;.$_review-&gt;getId().&#8217;\/&#8217; ?&gt;&quot;&gt;&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getTitle()) ?&gt;&lt;\/a&gt; &lt;?php echo $this-&gt;__(&#8216;Review by &lt;span&gt;%s&lt;\/span&gt;&#8217;, $this-&gt;htmlEscape($_review-&gt;getNickname())) ?&gt;<br \/>\n[\/php]<\/p>\n<p>\nHope this will help you \ud83d\ude42\n<\/p>\n<p>\n<br \/>\nRegards,<br \/>\nAmatya Trivedi<br \/>\namatya@intelligrape.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the most common customization in magento is to display reviews and ratings on the product page itself. This blog will show you how to render reviews and ratings on product page. Following are steps. Open your theme&#8217;s catalog.xml and include the following code inside block type=&#8221;catalog\/product_view&#8221; [php] &lt;!&#8211; For adding review page on [&hellip;]<\/p>\n","protected":false},"author":62,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":7},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9843"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=9843"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/9843\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=9843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=9843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=9843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}