Magento Expert Forum - Improve your Magento experience

Results 1 to 4 of 4

Multiple search results from two different attribute sets

  1. #1
    New member
    Join Date
    Jul 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Multiple search results from two different attribute sets

    I am trying to create two different search pages and two different results pages based on products in specific attribute sets.

    For discussion, I have two attribute sets, one called "AttributeSet1" and the other called "AttributeSet2."

    One search page should only return results within AttributeSet1 and the other only products within AttributeSet2.

    Any insight and/or resources to best accomplish without modifying core? Thank you in advance for the help.

    View more threads in the same category:


  2. #2
    Moderator speed2x's Avatar
    Join Date
    Mar 2013
    Location
    Hollywood, Florida, United States
    Posts
    88
    Thanks
    8
    Thanked 7 Times in 6 Posts

    Default

    I think this tutorial can help you http://www.magentocommerce.com/knowl...ble-attributes

  3. #3
    New member
    Join Date
    Jul 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by speed2x View Post
    Thanks for the suggestion, but the article you referenced deals more with filters in side navigation. I'm Looking to modify the quick search results to show products within in a predefined attribute set. Any idea how to accomplish this?

    Ultimately, I'll have two search pages, one for tools, and one for machines. Each search will only return results in the same attribute sets.

  4. #4
    Junior Member ToBai's Avatar
    Join Date
    Sep 2014
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You should probably rewrite model Mage_CatalogSearch_Model_Layer and work with the method prepareProductCollection. You should filter product collection by attribute set like this^

    $collection->addAttributeToFilter('attribute_set_id','33'); // write the correct attribute set id
    But you should choose which page is open now, I suppose each search page will have it's own URL:

    if ( strpos($_SERVER['REQUEST_URI'], "catalogsearch1") !== false ) // http://site.com/catalogsearch1/result/?q=test
    {
    $collection->addAttributeToFilter('attribute_set_id','33');
    }
    else if ( strpos($_SERVER['REQUEST_URI'], "catalogsearch2") !== false ) // http://site.com/catalogsearch2/result/?q=test
    {
    $collection->addAttributeToFilter('attribute_set_id','34');
    }

    If nothing helps you can contact us at our support page - http://www.to-bai.com/support/.

    We would be glad to help you with an advice or we can provide you our paid custom work - http://www.to-bai.com/services/custom-work.html

    ------------------------------------------
    ToBai Magento Extensions. - only best coding practice developing our applications. Our extensions:

    ToBai Extended Navigation, ToBai Extended Brand.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •