Try the Demo

Magento Forum

   
…set the default sort order for catalog pages? 
 
Hugoto
Member
 
Avatar
Total Posts:  33
Joined:  2008-08-11
 
Hugoto - 22 July 2009 12:59 PM

fragilem17 - 13 May 2009 01:49 AM
@above ... in version 3.1 you can set the default sort in the backend..

Hi Where is that option?

Thnks

Founded:  System > Configuration > Catalog > Frontend > Product listing sort by

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
akamyself
Jr. Member
 
Total Posts:  14
Joined:  2008-08-15
 

With 1.3.2.1 it’s really weird that articles can be sorted by position, name or price in the frontend while by best value, name or price in the backend…

I just want to have my categories sorted by position but previous solutions posted here does not seem to work anymore, I searched the toolbar.php but couldn’t find a line about the default sorting.

Anyone knows how to do this in these last versions of magento ?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
SG1
Jr. Member
 
Total Posts:  8
Joined:  2009-07-27
 

Thanks for all comments, the most of them help me a lot.

I would like to know if I could create a new atribute (Backend) and then use that attribute to order the products, hope I’ll be able to… in the meantime I will try by myself, if I find out a solution, I’ll post it here.

Regards.

 
Magento Community Magento Community
Magento Community
Magento Community
 
akamyself
Jr. Member
 
Total Posts:  14
Joined:  2008-08-15
 
akamyself - 03 August 2009 06:01 AM

With 1.3.2.1 it’s really weird that articles can be sorted by position, name or price in the frontend while by best value, name or price in the backend…

I just want to have my categories sorted by position but previous solutions posted here does not seem to work anymore, I searched the toolbar.php but couldn’t find a line about the default sorting.

Anyone knows how to do this in these last versions of magento ?

Thanks

For what it’s worth, tried the ‘best value’ sorting and it equals sorting by position.

Go figure…

 
Magento Community Magento Community
Magento Community
Magento Community
 
SG1
Jr. Member
 
Total Posts:  8
Joined:  2009-07-27
 
SG1 - 07 August 2009 01:52 AM

Thanks for all comments, the most of them help me a lot.

I would like to know if I could create a new atribute (Backend) and then use that attribute to order the products, hope I’ll be able to… in the meantime I will try by myself, if I find out a solution, I’ll post it here.


Regards.

Yes!!, it’s possible to create a new “attribute”, assign it to one or more “attribute set” and then order product list by that new attribute.  (Magento v1.1.7)

I created a new atrributed called “product_position” through Backend and I did the following modifications in a file: (yes, I know it’s hard coded but it’s only a test)

Modified File: DOCUMENT_ROOT\app\code\core\Mage\Catalog\Block\Product\List.php

Code modified: I just added two new methods in the class: Mage_Catalog_Block_Product_List (hard coded):

/**/
    public function getSortBy(){
    
        
return "product_position";
    
    
}
    
    
/**/
    
public function getSortOrder(){
    
        
return "desc";
    
    
}

The next step is to abstract my modifications in order not to hack the code and keep it just in case I upgrade to a new Magento Version , but I don’t know how to (I’m a noob in Magento), any ideas, suggestions or improvements are welcome.

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

hi there, is there anybody who every change its product list ?
at app/code/core/Mage/Catalog/Block/Product/List.php, change its _getProductCollection function ??

what I’m doing now is show A-Z products, so I change the code but there still many problems remains. One of them is sort problem, is there anyone who got the same issue ?

my code in _getProductCollection function :

if (is_null($this->_productCollection)) {
            $alphabet 
$this->getRequest()->getParam('key');
            
            
$toolbar $this->getToolbar();
            
$pageVarName $toolbar->getPageVarName();
            
$page $this->getRequest()->getParam($pageVarName);
            
            
$order $toolbar->getCurrentOrder();
            
$dir $toolbar->getCurrentDirection();
            
            
$collection Mage::getResourceModel('catalog/product_collection')
                ->
addAttributeToFilter('name', array('like'=> $alphabet.'%'))
                ->
addAttributeToFilter('status', array('enable' => true))
                ->
setCurPage($toolbar->getCurrentPage())
                ;
        
            
$attributes Mage::getSingleton('catalog/config')->getProductAttributes();
            
$collection->addAttributeToSelect($attributes);
            
            if ((int) 
$limit $toolbar->getLimit()) {
                $collection
->setPageSize($limit);
            
}
            
            
// this SETORDER STILL GOT LITTLE PROBLEM
            //if ($order) {
            //    $collection->setOrder($order, $dir);
            //} 
            
            
$collection->load();
            
$this->_productCollection $collection;

please give me your advice ....

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

still waiting for nice suggestion of what I’m doing....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Xtrem726
Member
 
Total Posts:  35
Joined:  2009-07-15
Bandung
 

I don’t understand, I only need “ How to display latest added products on my catalog list page ?” that’s all. !

 Signature 

EveryDayIsHell | http://www.blackidclothing.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
carolsancos
Jr. Member
 
Total Posts:  5
Joined:  2008-11-23
 

Thank you vlad.ifrim!! I spent hours looking for that

 
Magento Community Magento Community
Magento Community
Magento Community
 
E9
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-04-25
 

Well, i wanted to thank you for this tip, but i tried to open the file and search for the string to replace it but i could not find it.
i dono if the magento ver. makes a difference
mine is: 1.3.2.3
is there any other way please?
or can i pay someone to fix this for me?

thank you

 Signature 

Every man dies, but not every man really lives…

http://www.q8shop.biz
http://www.usbhak.com
http://www.xploitbox.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
scjunkies
Member
 
Total Posts:  55
Joined:  2008-09-03
Houston, Texas, USA
 
E9 - 23 September 2009 02:42 AM

Well, i wanted to thank you for this tip, but i tried to open the file and search for the string to replace it but i could not find it.
i dono if the magento ver. makes a difference
mine is: 1.3.2.3
is there any other way please?
or can i pay someone to fix this for me?

thank you

Did you get anyone to help you?  I want to display random products on the category list.  However, the Hack listed above does not seem to apply to version 1.3.2.4.  Can anyone help?

 Signature 

Garage Flooring (Garage Floor Tiles) at FloorJunkies.com
Portable Dance Floor | Modular Floor | Trade Show Flooring | Basement Flooring

 
Magento Community Magento Community
Magento Community
Magento Community
 
E9
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-04-25
 

Well so far no one replied yet

but i submitted the request to one of the companies that i bought some plugins from
and i hope that they reply soon

i will keep you posted here in case they replied to me

mean while, have a look at their plugins it is really good to have and use

its here:

http://www.hello-magento.com/extensions-modules-plugins/

if you wanted to buy any of them, just refer my domain: q8shop.biz

they are really a good team of support

thank you

 Signature 

Every man dies, but not every man really lives…

http://www.q8shop.biz
http://www.usbhak.com
http://www.xploitbox.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
E9
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-04-25
 

I finally got the reply from the Support team @ http://www.hello-magento.com/

and this was their answer:
____________________

Could you use the code in the content of cms home page:

{{block type="newproducts/newproductstoolbar" number_day="300" name="newproducts_simpletoolbar"
template="hm/newproducts_simpletoolbar.phtml" }}

The number_day =300 it means it will list products in last 300days and sort by date.

_____________________

and it works for my website:  http://www.q8shop.biz

you may have a look

 Signature 

Every man dies, but not every man really lives…

http://www.q8shop.biz
http://www.usbhak.com
http://www.xploitbox.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
scjunkies
Member
 
Total Posts:  55
Joined:  2008-09-03
Houston, Texas, USA
 

E9 Thanks for the reply but what you posted did not help me. I’m looking to list the products in a category randomly. There was a solution for that in this post on page 2 i think. However, with the upgrade to 1.3.2.x it no longer works.  Better stated, I don’t know how to implement it due to the change in the core files.

 Signature 

Garage Flooring (Garage Floor Tiles) at FloorJunkies.com
Portable Dance Floor | Modular Floor | Trade Show Flooring | Basement Flooring

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcm1
Jr. Member
 
Total Posts:  6
Joined:  2009-02-26
 

I need to sort price descending. I changed it to price in admin.

I changed line 97 in Toolbar.php to:

protected $_direction = ‘desc’;

(instead of asc)

Worked nicely.

Thanks for all the previous posts.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top