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

How to search all the products while selecting an attribute option like ‘All’? 
 
cielliang
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2008-02-22
Shanghai, China
 

Here we are:
In magento’s advanced search, we can only start an advanced search by specifying at least one attribute.

Target:
We want to response all the product, IF, we pick the option ‘All’.
Option ‘All’, we can add it in file

./app/code/core/Mage/CatalogSearch/Block/Advance/Form.php
And in function:
public function getAttributeSelectElement($attribute)

Found:
In:

./app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php
We can find:
function addAttributeToSelect($attribute$joinType=false)
The comment says:
/**
     * Add attribute to entities in collection
     *
     * If $attribute=='*' select all attributes
     *
     * @param array|string|integer|Mage_Core_Model_Config_Element $attribute
     * @return Mage_Eav_Model_Entity_Collection_Abstract
     */

So, I think there should be some ways to achieve the goal.

Any idea?

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