{"id":114,"date":"2011-05-27T03:43:16","date_gmt":"2011-05-27T03:43:16","guid":{"rendered":"http:\/\/www.evermoredevnotes.com\/?p=114"},"modified":"2011-05-27T03:43:16","modified_gmt":"2011-05-27T03:43:16","slug":"magento-different-sort-dropdown","status":"publish","type":"post","link":"https:\/\/www.evermoretechnologies.com\/blog\/2011\/05\/magento-different-sort-dropdown\/","title":{"rendered":"Magento different sort dropdown."},"content":{"rendered":"<p>Sometimes you need\/want a better dropdown for magento sorting. \u00a0Here&#8217;s an example of how to make one.<\/p>\n<p>Try using this code for template\/catalog\/product\/list\/toolbar.phtml<\/p>\n<p>[code language=&#8221;php&#8221;]<br \/>\n&lt;fieldset class=&quot;sort-by&quot;&gt;<br \/>\n\t  &lt;label&gt;&lt;?php echo $this-&gt;__(&#8216;Sort by&#8217;) ?&gt;&lt;\/label&gt;<br \/>\n\t  &lt;select onchange=&quot;setLocation(this.value)&quot;&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;position&#8217;, &#8216;asc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;position&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;asc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Featured<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;price&#8217;, &#8216;asc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;price&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;asc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Lowest Price<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;price&#8217;, &#8216;desc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;price&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;desc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Highest Price<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;name&#8217;, &#8216;asc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;name&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;asc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Name A-Z<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;name&#8217;, &#8216;desc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;name&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;desc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Name Z-A<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;entity_id&#8217;, &#8216;desc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;entity_id&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;desc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Newest to Oldest<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t\t\t&lt;option value=&quot;&lt;?php echo $this-&gt;getOrderUrl(&#8216;entity_id&#8217;, &#8216;asc&#8217;) ?&gt;&quot;&lt;?php if($this-&gt;isOrderCurrent(&#8216;entity_id&#8217;) &amp;&amp; $this-&gt;getCurrentDirection() == &#8216;asc&#8217;): ?&gt; selected=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;<br \/>\n\t\t\t\t Oldest to Newest<br \/>\n\t\t\t&lt;\/option&gt;<br \/>\n\t  &lt;\/select&gt;<br \/>\n &lt;\/fieldset&gt;<br \/>\n[\/code]<\/p>\n<p>This code was pulled from an answer to a blog post here.  http:\/\/magentoexpert.com\/ascending-descending-sort-by-order\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you need\/want a better dropdown for magento sorting. \u00a0Here&#8217;s an example of how to make one. Try using this code for template\/catalog\/product\/list\/toolbar.phtml [code language=&#8221;php&#8221;] &lt;fieldset class=&quot;sort-by&quot;&gt; &lt;label&gt;&lt;?php echo $this-&gt;__(&#8216;Sort&#8230; <a href=\"https:\/\/www.evermoretechnologies.com\/blog\/2011\/05\/magento-different-sort-dropdown\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/114"}],"collection":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":0,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}