<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Showing all reviews and ratings on a page in Magento</title>
	<atom:link href="http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/</link>
	<description>Refresh your vision</description>
	<lastBuildDate>Tue, 31 Jan 2012 01:12:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Michael C.</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1225</link>
		<dc:creator>Michael C.</dc:creator>
		<pubDate>Sun, 29 Jan 2012 23:38:58 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1225</guid>
		<description>Just wanna say thanks for posting this.  It saved me from potentially hours of fruitless work.  The code worked perfectly.  I plan to use this to display reviews inline with a product, and also add an AJAXified rating/review widget.</description>
		<content:encoded><![CDATA[<p>Just wanna say thanks for posting this.  It saved me from potentially hours of fruitless work.  The code worked perfectly.  I plan to use this to display reviews inline with a product, and also add an AJAXified rating/review widget.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cristi</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1170</link>
		<dc:creator>Cristi</dc:creator>
		<pubDate>Wed, 19 Oct 2011 12:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1170</guid>
		<description>I suppose you would like to only show the reviews of a certain list of products. You could try to filter by the product id. Quickly checking the &lt;code&gt;Mage_Review_Model_Mysql4_Review_Collection&lt;/code&gt; class, there&#039;s no way to do that, so I went up the class hierarchy and found the method &lt;code&gt;addFieldToFilter&lt;/code&gt; in &lt;code&gt;Varien_Data_Collection_Db&lt;/code&gt;. This should probably do the trick: &lt;code&gt;$reviews-&gt;addFieldToFilter(&#039;entity_pk_value&#039;, array(&#039;in&#039; =&gt; array( ... list of product ids ... )))&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I suppose you would like to only show the reviews of a certain list of products. You could try to filter by the product id. Quickly checking the <code>Mage_Review_Model_Mysql4_Review_Collection</code> class, there&#8217;s no way to do that, so I went up the class hierarchy and found the method <code>addFieldToFilter</code> in <code>Varien_Data_Collection_Db</code>. This should probably do the trick: <code>$reviews->addFieldToFilter('entity_pk_value', array('in' => array( ... list of product ids ... )))</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aknal</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1169</link>
		<dc:creator>Aknal</dc:creator>
		<pubDate>Wed, 19 Oct 2011 11:33:23 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1169</guid>
		<description>How to get reviews for group of product ids</description>
		<content:encoded><![CDATA[<p>How to get reviews for group of product ids</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cristi</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1132</link>
		<dc:creator>Cristi</dc:creator>
		<pubDate>Mon, 18 Jul 2011 20:48:25 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1132</guid>
		<description>i think $_prod-&gt;getName() and $_prod-&gt;getImage() (or getSmallImage()) should work fine inside that loop.</description>
		<content:encoded><![CDATA[<p>i think $_prod->getName() and $_prod->getImage() (or getSmallImage()) should work fine inside that loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1131</link>
		<dc:creator>Laurent</dc:creator>
		<pubDate>Mon, 18 Jul 2011 16:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1131</guid>
		<description>Hi Guys, 

Thank you for this post.

However, it works displaying the reviews but I can&#039;t get the product name and product image. Here is my php file: 
getResourceCollection();
		$reviews-&gt;addStoreFilter( Mage::app()-&gt;getStore()-&gt;getId() )
						-&gt;addStatusFilter( Mage_Review_Model_Review::STATUS_APPROVED )
						-&gt;setDateOrder()
						-&gt;addRateVotes()
						-&gt;load();        

		return $reviews;
	}

	function getProduct( Mage_Review_Model_Review $review ) {
		if( !isset($this-&gt;_loadedProducts[ $review-&gt;getEntityPkValue() ]) ) {
			$this-&gt;_loadedProducts[$review-&gt;getEntityPkValue()] = Mage::getModel(&#039;catalog/product&#039;)-&gt;load( $review-&gt;getEntityPkValue() );
		}

		return $this-&gt;_loadedProducts[ $review-&gt;getEntityPkValue() ];
	}

	function getAverageRating( Mage_Review_Model_Review $review ) {
		$avg = 0;
		if( count($review-&gt;getRatingVotes()) ) {
			$ratings = array();
			foreach( $review-&gt;getRatingVotes() as $rating ) {
				$ratings[] = $rating-&gt;getPercent();
			}
			$avg = array_sum($ratings)/count($ratings);
		}

		return $avg;
	}

}

And here is the phtml file:


	
				Title
                Details
                Nickname
                Date
                Product Name
                Product Image
                Avg. Rating
	
getReviews() as $review) {
   	$review_prod = $this-&gt;getProduct($review);
   	$_prod = $this-&gt;getProduct( $review );
?&gt;
	
				getTitle()?&gt;
                getDetail()?&gt;
                getNickname()?&gt;
                getCreatedAt()?&gt;
                
                
                &lt;div class=&quot;rating&quot; style=&quot;width: getAverageRating( $review )); ?&gt;%;&quot;&gt;
	  

</description>
		<content:encoded><![CDATA[<p>Hi Guys, </p>
<p>Thank you for this post.</p>
<p>However, it works displaying the reviews but I can&#8217;t get the product name and product image. Here is my php file:<br />
getResourceCollection();<br />
		$reviews-&gt;addStoreFilter( Mage::app()-&gt;getStore()-&gt;getId() )<br />
						-&gt;addStatusFilter( Mage_Review_Model_Review::STATUS_APPROVED )<br />
						-&gt;setDateOrder()<br />
						-&gt;addRateVotes()<br />
						-&gt;load();        </p>
<p>		return $reviews;<br />
	}</p>
<p>	function getProduct( Mage_Review_Model_Review $review ) {<br />
		if( !isset($this-&gt;_loadedProducts[ $review-&gt;getEntityPkValue() ]) ) {<br />
			$this-&gt;_loadedProducts[$review-&gt;getEntityPkValue()] = Mage::getModel(&#8216;catalog/product&#8217;)-&gt;load( $review-&gt;getEntityPkValue() );<br />
		}</p>
<p>		return $this-&gt;_loadedProducts[ $review-&gt;getEntityPkValue() ];<br />
	}</p>
<p>	function getAverageRating( Mage_Review_Model_Review $review ) {<br />
		$avg = 0;<br />
		if( count($review-&gt;getRatingVotes()) ) {<br />
			$ratings = array();<br />
			foreach( $review-&gt;getRatingVotes() as $rating ) {<br />
				$ratings[] = $rating-&gt;getPercent();<br />
			}<br />
			$avg = array_sum($ratings)/count($ratings);<br />
		}</p>
<p>		return $avg;<br />
	}</p>
<p>}</p>
<p>And here is the phtml file:</p>
<p>				Title<br />
                Details<br />
                Nickname<br />
                Date<br />
                Product Name<br />
                Product Image<br />
                Avg. Rating</p>
<p>getReviews() as $review) {<br />
   	$review_prod = $this-&gt;getProduct($review);<br />
   	$_prod = $this-&gt;getProduct( $review );<br />
?&gt;</p>
<p>				getTitle()?&gt;<br />
                getDetail()?&gt;<br />
                getNickname()?&gt;<br />
                getCreatedAt()?&gt;</p>
<p>                &lt;div class=&quot;rating&quot; style=&quot;width: getAverageRating( $review )); ?&gt;%;&#8221;&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cristi</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1028</link>
		<dc:creator>Cristi</dc:creator>
		<pubDate>Wed, 05 Jan 2011 15:23:18 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1028</guid>
		<description>@daan &amp; @paul - Hope this helps: http://mandagreen.com/anatomy-of-a-magento-extension/</description>
		<content:encoded><![CDATA[<p>@daan &#038; @paul &#8211; Hope this helps: <a href="http://mandagreen.com/anatomy-of-a-magento-extension/" rel="nofollow">http://mandagreen.com/anatomy-of-a-magento-extension/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daan</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1027</link>
		<dc:creator>Daan</dc:creator>
		<pubDate>Wed, 05 Jan 2011 09:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1027</guid>
		<description>Any update on that ZIP? I&#039;m just beginning with magento, but would love to study the structure, I don&#039;t know how to add a custom module, and the tutorials on other sites doesn&#039;t get me in the right direction..</description>
		<content:encoded><![CDATA[<p>Any update on that ZIP? I&#8217;m just beginning with magento, but would love to study the structure, I don&#8217;t know how to add a custom module, and the tutorials on other sites doesn&#8217;t get me in the right direction..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Bates</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1017</link>
		<dc:creator>Paul Bates</dc:creator>
		<pubDate>Fri, 03 Dec 2010 09:10:19 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1017</guid>
		<description>&lt;a href=&quot;#comment-1015&quot; rel=&quot;nofollow&quot;&gt;@Cristi&lt;/a&gt; 
I fully understand where your coming from Cristi, to prove my request wasn&#039;t just laziness I did follow up and investigate creating blocks and templates etc. and discovered the ModuleCreator Ext. unfortunately I wouldn&#039;t run and documentation is limited. If you can get a zip to download it will be more appreciated than you can imagine. Thanks.</description>
		<content:encoded><![CDATA[<p><a href="#comment-1015" rel="nofollow">@Cristi</a><br />
I fully understand where your coming from Cristi, to prove my request wasn&#8217;t just laziness I did follow up and investigate creating blocks and templates etc. and discovered the ModuleCreator Ext. unfortunately I wouldn&#8217;t run and documentation is limited. If you can get a zip to download it will be more appreciated than you can imagine. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cristi</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1015</link>
		<dc:creator>Cristi</dc:creator>
		<pubDate>Sun, 28 Nov 2010 23:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1015</guid>
		<description>I&#039;ve removed the links, I think the url field should be enough to link to your website(s).
Regarding your problem, I agree that most of the time a zip would save a lot, I also prefer to check full code too. However, in this case I didn&#039;t have enough time to &quot;extract&quot; the files from the project that it was developed on. 
On the other hand, if you&#039;re not comfortable with creating a block &amp; template in magento, I advise hiring a pro or at least someone who knows what they&#039;re doing. there are freelancers all over the place now (elance, odesk, rent a coder), more or less reliable and more or less expensive. i&#039;ll see if i can zip this the following days and will leave a comment if I do.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve removed the links, I think the url field should be enough to link to your website(s).<br />
Regarding your problem, I agree that most of the time a zip would save a lot, I also prefer to check full code too. However, in this case I didn&#8217;t have enough time to &#8220;extract&#8221; the files from the project that it was developed on.<br />
On the other hand, if you&#8217;re not comfortable with creating a block &#038; template in magento, I advise hiring a pro or at least someone who knows what they&#8217;re doing. there are freelancers all over the place now (elance, odesk, rent a coder), more or less reliable and more or less expensive. i&#8217;ll see if i can zip this the following days and will leave a comment if I do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Bates</title>
		<link>http://mandagreen.com/showing-all-reviews-and-ratings-on-a-page-in-magento/comment-page-1/#comment-1012</link>
		<dc:creator>Paul Bates</dc:creator>
		<pubDate>Sat, 27 Nov 2010 20:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://mandagreen.com/?p=80#comment-1012</guid>
		<description>Sounds all good, unfortunately most of it went over my head (I&#039;m getting old and simplicity reigns supreme).

Personally I would love to have a nice zip file to download so I could study the structure with clarity. Instructions like &quot;You’ll only need to manipulate a block and a template.&quot; are although simple very confusing to us whom have little tinkering knowledge within magentos&#039; code.

Before I spend some hard earned on a widget I wonder if any indian givers can put me out of my misery and send the code for me to hack about.
</description>
		<content:encoded><![CDATA[<p>Sounds all good, unfortunately most of it went over my head (I&#8217;m getting old and simplicity reigns supreme).</p>
<p>Personally I would love to have a nice zip file to download so I could study the structure with clarity. Instructions like &#8220;You’ll only need to manipulate a block and a template.&#8221; are although simple very confusing to us whom have little tinkering knowledge within magentos&#8217; code.</p>
<p>Before I spend some hard earned on a widget I wonder if any indian givers can put me out of my misery and send the code for me to hack about.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

