<?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: Magento Default Products Sort Order Newest</title>
	<atom:link href="http://www.redbridgenet.com/howto/magento-default-products-sort-order-newest/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/</link>
	<description>Professional WordPress and WordPress Plugin Developers in the San Francisco Bay Area</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:44:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: A Tucson Web Designer</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-5055</link>
		<dc:creator>A Tucson Web Designer</dc:creator>
		<pubDate>Thu, 21 Jul 2011 16:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-5055</guid>
		<description>Great article, but the tough part that I&#039;m looking for is sorting via a custom order.  It&#039;s tricky because you&#039;ll need to create a custom attribute for that and then change the product sort by adding a module to override the list.phtml template in Magento 1.5.1.  Maybe I&#039;ll post an article about it and link it to this.</description>
		<content:encoded><![CDATA[<p>Great article, but the tough part that I&#8217;m looking for is sorting via a custom order.  It&#8217;s tricky because you&#8217;ll need to create a custom attribute for that and then change the product sort by adding a module to override the list.phtml template in Magento 1.5.1.  Maybe I&#8217;ll post an article about it and link it to this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tuba</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-5029</link>
		<dc:creator>tuba</dc:creator>
		<pubDate>Wed, 22 Jun 2011 22:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-5029</guid>
		<description>very helpful and nice trick! Thank you!</description>
		<content:encoded><![CDATA[<p>very helpful and nice trick! Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4991</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 26 Apr 2011 00:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4991</guid>
		<description>1.5.1

I had to add code in toolbar.php because the &quot;available order array&quot; was not there. I was looking to add &quot;rating summary&quot; to the array.

This is from several other posters, not my code, perhaps is more clear in my summary (hopefully helpful to someone )as this was in pieces in several posts over different forums. Thanks to posters!
--------
Toolbar.php
Line 233
public function setCollection($collection)
    {
        parent::setCollection($collection);
        if ($this-&gt;getCurrentOrder()) {
     ---------------       
            // Begin new Code
            $this-&gt;getCollection()-&gt;joinField(&#039;rating&#039;,
                   &#039;review/review_aggregate&#039;,
                &#039;rating_summary&#039;,
                &#039;entity_pk_value=entity_id&#039;,
                &#039;{{table}}.store_id=1&#039;,
                &#039;left&#039;);
            // End new Code
       -----------------     
            $this-&gt;getCollection()-&gt;setOrder($this-&gt;getCurrentOrder(), $this-&gt;getCurrentDirection());
        }
        return $this;
    }
----------
Line 422 ( after adding lines at 233)

public function getAvailableOrders()
    {
	// Add rating to &quot;Sort by&quot;
	$_availableOrder = $this-&gt;_availableOrder;
        $_availableOrder[&#039;rating&#039;] = &#039;Rating&#039;;
        return $_availableOrder;
	
       $this-&gt;_availableOrder = array(
‘entity_id’ =&gt; Mage::helper(’catalog’)-&gt;__(’Newest’),
‘name’ =&gt; Mage::helper(’catalog’)-&gt;__(’Name’),
‘price’ =&gt; Mage::helper(’catalog’)-&gt;__(’Price’),
‘rating_summary’ =&gt; Mage::helper(’catalog’)-&gt;__(’Rating’)
);

return $this-&gt;_availableOrder; 
    }
________

This works but displays:

Position
Name 
Price 
Rating

I was expecting it to display

Newest
Name
Price
Rating

I do not think Position is equal to Newest?
And I changed line 119 to
protected $_direction = ‘desc’;
but does not seem to have any effect.

I am wanting to display
Reviews: descending
Newest: descending
Price: ascending

and not show Position.
Thanks for any help or pointers.
Bryan.</description>
		<content:encoded><![CDATA[<p>1.5.1</p>
<p>I had to add code in toolbar.php because the &#8220;available order array&#8221; was not there. I was looking to add &#8220;rating summary&#8221; to the array.</p>
<p>This is from several other posters, not my code, perhaps is more clear in my summary (hopefully helpful to someone )as this was in pieces in several posts over different forums. Thanks to posters!<br />
&#8212;&#8212;&#8211;<br />
Toolbar.php<br />
Line 233<br />
public function setCollection($collection)<br />
    {<br />
        parent::setCollection($collection);<br />
        if ($this-&gt;getCurrentOrder()) {<br />
     &#8212;&#8212;&#8212;&#8212;&#8212;<br />
            // Begin new Code<br />
            $this-&gt;getCollection()-&gt;joinField(&#8216;rating&#8217;,<br />
                   &#8216;review/review_aggregate&#8217;,<br />
                &#8216;rating_summary&#8217;,<br />
                &#8216;entity_pk_value=entity_id&#8217;,<br />
                &#8216;{{table}}.store_id=1&#8242;,<br />
                &#8216;left&#8217;);<br />
            // End new Code<br />
       &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
            $this-&gt;getCollection()-&gt;setOrder($this-&gt;getCurrentOrder(), $this-&gt;getCurrentDirection());<br />
        }<br />
        return $this;<br />
    }<br />
&#8212;&#8212;&#8212;-<br />
Line 422 ( after adding lines at 233)</p>
<p>public function getAvailableOrders()<br />
    {<br />
	// Add rating to &#8220;Sort by&#8221;<br />
	$_availableOrder = $this-&gt;_availableOrder;<br />
        $_availableOrder['rating'] = &#8216;Rating&#8217;;<br />
        return $_availableOrder;</p>
<p>       $this-&gt;_availableOrder = array(<br />
‘entity_id’ =&gt; Mage::helper(’catalog’)-&gt;__(’Newest’),<br />
‘name’ =&gt; Mage::helper(’catalog’)-&gt;__(’Name’),<br />
‘price’ =&gt; Mage::helper(’catalog’)-&gt;__(’Price’),<br />
‘rating_summary’ =&gt; Mage::helper(’catalog’)-&gt;__(’Rating’)<br />
);</p>
<p>return $this-&gt;_availableOrder;<br />
    }<br />
________</p>
<p>This works but displays:</p>
<p>Position<br />
Name<br />
Price<br />
Rating</p>
<p>I was expecting it to display</p>
<p>Newest<br />
Name<br />
Price<br />
Rating</p>
<p>I do not think Position is equal to Newest?<br />
And I changed line 119 to<br />
protected $_direction = ‘desc’;<br />
but does not seem to have any effect.</p>
<p>I am wanting to display<br />
Reviews: descending<br />
Newest: descending<br />
Price: ascending</p>
<p>and not show Position.<br />
Thanks for any help or pointers.<br />
Bryan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prashant</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4840</link>
		<dc:creator>Prashant</dc:creator>
		<pubDate>Mon, 31 Jan 2011 08:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4840</guid>
		<description>nice thanks...</description>
		<content:encoded><![CDATA[<p>nice thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vipinss316</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4822</link>
		<dc:creator>vipinss316</dc:creator>
		<pubDate>Mon, 27 Dec 2010 13:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4822</guid>
		<description>thnx a lot</description>
		<content:encoded><![CDATA[<p>thnx a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scott</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4573</link>
		<dc:creator>scott</dc:creator>
		<pubDate>Sat, 14 Aug 2010 00:38:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4573</guid>
		<description>Even easier yet.  Just add this to custom layout for the categories you want to reverse the order of.



desc</description>
		<content:encoded><![CDATA[<p>Even easier yet.  Just add this to custom layout for the categories you want to reverse the order of.</p>
<p>desc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sacha</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4572</link>
		<dc:creator>Sacha</dc:creator>
		<pubDate>Mon, 26 Jul 2010 13:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4572</guid>
		<description>Thanx! This is awesome!!</description>
		<content:encoded><![CDATA[<p>Thanx! This is awesome!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ANDiTKO</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4571</link>
		<dc:creator>ANDiTKO</dc:creator>
		<pubDate>Tue, 01 Jun 2010 18:01:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4571</guid>
		<description>For Magento 1.4 Change line 119 to:
protected $_direction = &#039;desc&#039;;</description>
		<content:encoded><![CDATA[<p>For Magento 1.4 Change line 119 to:<br />
protected $_direction = &#8216;desc&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: artur</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4570</link>
		<dc:creator>artur</dc:creator>
		<pubDate>Tue, 25 May 2010 18:45:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4570</guid>
		<description>hello to all, do you know maybe how to do it in magento 1.4? adding new attribute doesn&#039;t work - it listing with known only to itself way and in different way each time... so, i would like to hack code or even change position option for entity_id or something. i would be very thankful for your help!</description>
		<content:encoded><![CDATA[<p>hello to all, do you know maybe how to do it in magento 1.4? adding new attribute doesn&#8217;t work &#8211; it listing with known only to itself way and in different way each time&#8230; so, i would like to hack code or even change position option for entity_id or something. i would be very thankful for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me</title>
		<link>http://www.redbridgenet.com/how-to/magento-default-products-sort-order-newest/comment-page-1/#comment-4569</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Fri, 14 May 2010 14:57:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.kliky.net/howto/magento-products-sort-order-newest/#comment-4569</guid>
		<description>You are a genius .....Thanks lots</description>
		<content:encoded><![CDATA[<p>You are a genius &#8230;..Thanks lots</p>
]]></content:encoded>
	</item>
</channel>
</rss>

