SupFrig
SupFrig

Reputation: 365

Can i search for all product in search

i'm looking for a way in magento search to display all products. it's for a quick search by attribute purpose, i implemented GET filters which adds attributes to filter to collection list, and i want to apply them to the full products collection.

if(count($_GET) > 0 && $isSearchPage){
$_productCollection = $_productCollection->clear()->addAttributeToSelect('*');
$suffix = array();
foreach($_GET as $filter => $value){
    $suffix[$filter] = $value;
    if($filter != 'q' && $filter != 'limit' && $filter != 'p'){
        $_productCollection->addAttributeToFilter($filter,$value);
    }
}
}

So far i tried

/catalogsearch/result/?q=%
/catalogsearch/result/?q=*

q=% return results, but not all of them. Is there a way to do what i'm trying to achieve ? Or am I heading in the wrong direction

Upvotes: 2

Views: 65

Answers (1)

Rohit S
Rohit S

Reputation: 1040

Magento alreay have Advanced search feature where you can search the products based on the attribute .You can see the demo of this feature here .Maybe you can extend it according to your need.

Upvotes: 1

Related Questions