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

Search product filter by category
 
emanuelq
Jr. Member
 
Total Posts:  18
Joined:  2008-04-28
 

Hi guys!
I need to make a search that allow to filter by category, any ideas of how I can do that?

All the best,
Emanuel

 
Magento Community Magento Community
Magento Community
Magento Community
 
emanuelq
Jr. Member
 
Total Posts:  18
Joined:  2008-04-28
 

Hi Again guys!
No ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
emanuelq
Jr. Member
 
Total Posts:  18
Joined:  2008-04-28
 

I did it… in a nasty way.
I added code in line 43 of app/code/core/Mage/CatalogSearch/Model/Query.php.

<pre>
if (isset($_GET["id_cat"]))
$collection->addAttributeToFilter(’category_ids’, Array($_GET["id_cat"]));
</pre>

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Well you can use the layered navigation, that allows you to filter by category.

 
Magento Community Magento Community
Magento Community
Magento Community
 
emanuelq
Jr. Member
 
Total Posts:  18
Joined:  2008-04-28
 

this works for search too?
Can you show me an example of that?

Cheers,
Emanuel

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

No, it just allows you to filter by category when looking at products - so I guess it doesn’t actually accomplish what you need.

 
Magento Community Magento Community
Magento Community
Magento Community
 
beau
Member
 
Avatar
Total Posts:  50
Joined:  2008-02-03
 

Hi Sherrie - do you know if this was intentional? Is there some way I should be setting up my products so that, when I want to see just the hats, for instance, I can do that?

In my case, I need to feature all the halloween stuff on the home page - and I’m doing that by using the “NEW” to and from dates to set them up. But I’ve got a big collection of stuff already. Eventually I’m going to have hundreds of things in there.

Surely there’s a way to find all things in one category? Somehow?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

You can do that just by displaying the following code in your CMS home page, just change the # to the category you want to use:

{{block type="catalog/product_list" category_id="149" template="catalog/product/list.phtml"}}
 
Magento Community Magento Community
Magento Community
Magento Community
 
beau
Member
 
Avatar
Total Posts:  50
Joined:  2008-02-03
 

Sorry Sherrie - I mean, on the backend, when I’m editing/adding products. I should have specified that.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Oh, I’m not sure how to narrow it by category in the backend, sorry!

 
Magento Community Magento Community
Magento Community
Magento Community
 
beau
Member
 
Avatar
Total Posts:  50
Joined:  2008-02-03
 

Hi. I just found the answer to this while I was reading the Magento Users Guide. Duh!

Simply select the desired category, and access the Category Products tab (from the top of the category page).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

Check out these extension. They greatly improve the quality and relevance of search results Advanced Search for Shared Hosting http://mirasvit.com/magento-extensions/magento-advanced-search-for-shared-hosting.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
maykov
Jr. Member
 
Total Posts:  4
Joined:  2013-08-10
 

We are usig extension to filtering/sorting/search products by categories Advanced Admin Products Manager with much more hot features. Also you ca look to this one for such tasks Mass Product Categories Updater.

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