Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Set multiple custom sort options
 
slamdunk73
Jr. Member
 
Total Posts:  5
Joined:  2008-12-04
California, USA
 

I’m trying to sort all of the items on my site using a custom attribute, and then sort by the options configured in Magento.  First, I create the custom attribute and assign all the products with it.  Here is the code:

Using Magento 1.4:

/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php

in the public function setCollection($collection) around line (232)

if ($this->getCurrentOrder()) {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}

changed to

if ($this->getCurrentOrder()) {
$this->_collection->setOrder(’twin_flag’, ‘DESC’);
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
hkp
Jr. Member
 
Total Posts:  3
Joined:  2010-10-05
 

hi,

I want to set multiple sorting option on product listing page . Where user can first sort by price then name and then subcategory
So anyone have any idea how can i achieve this using magento 1.4.1?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

You need to modify /app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php and appropricate templates to allow selection (and then de-selection) of the sorting options. You may try to add several dropdowns with sorting options. Post a solution if you find it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
q23media
Member
 
Avatar
Total Posts:  72
Joined:  2009-04-29
 

hi there! any solutions for this? what exactly do i need to change in the toolbar.php?

Thanks allot
Jakob

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