Try the Demo

Magento Forum

   
Page 11 of 11
…set the default sort order for catalog pages? 
 
colin008
Sr. Member
 
Total Posts:  84
Joined:  2008-10-20
 

What about changing the sort order (ASC or DESC) on a per category basis, this code works fine on 1.5.1 in Category>Custom Design>Custom Layout Update

<reference name="content">
<
block name="category.products">
<
block name="product_list">
<
block name="product_list_toolbar">
<
action method="setDefaultDirection"><dir>desc</dir></action>
</
block>
</
block>
</
block>
</
reference>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Indigo Blue
Jr. Member
 
Total Posts:  3
Joined:  2012-09-24
 

where do i find app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php?  I desperately need to change my default sorting order to Price descending.  Also - what are the default sorting options?  I have removed Best Value and now only have Price as an option.  I would like to search by designer/brand but I am not sure if this is possible?

http://www.indigobluetrading.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Indigo Blue
Jr. Member
 
Total Posts:  3
Joined:  2012-09-24
 

Colin

I have tried to add the code that you suggested to the custom layout field within the individual categories to change the default sorting order from ascending to descending but it doesn’t work for me.  It works for about 2 mins and then it reverts back to price ascending.  any further ideas or advice on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
pradeep_kumar67
Sr. Member
 
Avatar
Total Posts:  136
Joined:  2010-06-24
Bangalore
 

please check this post

http://www.magentocommerce.com/boards/viewthread/287173/

its some what fix , here i added most viewed in category sort by option, if you get error i gave solution to fix it also

 Signature 

Pradeep Kumar, Magento Developer in Bangalore India, Magento Programmer in Bangalore India, Magento Expert In Bangalore India, Magento Developer India , Magento Programmer India, Magento Expert India, http://pradeepkumarrcs.blogspot.in/, linkedin.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
headwaystl
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2011-08-15
St. Louis, MO
 

The following changes worked for me on Community edition 1.7.0.2. Now all category pages list products in descending order by price.

In /theme-name/template/catalog/product/list/toolbar.phtml change (line 82 for me):

$this->getOrderUrl($_key'asc')

to

$this->getOrderUrl($_key'desc')

Then in /theme-name/layout/catalog.xml add the following to the product_list_toolbar block under the Category default layout (line 86 for me):

<action method="setDefaultDirection"><string>desc</string></action>

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
CafeBandito
Jr. Member
 
Total Posts:  13
Joined:  2012-01-31
 

Hey guys,

This worked for me.

Edit this file: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
(sidenote, I always make a backup of files I edit and rename it something like ToolbarBACKUP.php)

Find this code:

public function setDefaultDirection($dir)
    
{
        
if (in_array(strtolower($dir), array('asc''desc'))) {
            $this
->_direction strtolower($dir);
        
}
        
return $this;
    
}

Change ‘asc’ to ‘desc’ and change ‘desc’ to ‘asc’.

Presto!

 
Magento Community Magento Community
Magento Community
Magento Community
 
CafeBandito
Jr. Member
 
Total Posts:  13
Joined:  2012-01-31
 

Hey guys,

This worked for me.

Edit this file: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
(sidenote, I always make a backup of files I edit and rename it something like ToolbarBACKUP.php)

Find this code:

public function setDefaultDirection($dir)
    
{
        
if (in_array(strtolower($dir), array('asc''desc'))) {
            $this
->_direction strtolower($dir);
        
}
        
return $this;
    
}

Change ‘asc’ to ‘desc’ and change ‘desc’ to ‘asc’.

Presto!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Babados
Jr. Member
 
Total Posts:  4
Joined:  2013-03-14
 


http://www.australia101-201.boards.net/

Australia 101 Dumps - 100% validity!!

i am a verified dumps seller




website = australia101-201(DOT)boards(DOT)net/
Australia 101 Dumps - 100% validity!!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 11 of 11