Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Custom Fields added to Site Search

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2217 Views
  • Terry Apodaca
    Avatar
    Community Member
    109 Posts

    Custom Fields added to Site Search Link to this post

    I have the Ecommerce Module installed and working great. Client loves it!

    One thing I need to figure out how to do is add custom fields the Site Search. On the Product page (CMS) I have given the client a few new fields that don't come standard with the default module. The issue is they want those to be searchable on the front end and from what I can tell the Site Search will only search the Title fields and the Content fields...not the others

    Is there something I can do to get the Custom Fields added to the Site Search?

  • inCharge
    Avatar
    Community Member
    102 Posts

    Re: Custom Fields added to Site Search Link to this post

    I asked the same question a while back...

    http://silverstripe.org/customising-the-cms/show/14574

    ...but I still haven't got around to implementing Sphinx.

  • Terry Apodaca
    Avatar
    Community Member
    109 Posts

    Re: Custom Fields added to Site Search Link to this post

    Yeah, I can't do the Sphinx module.

    There has to be an easier way to add custom fields to the front facing search. They allow it in the CMS, and now it's easy to add regular DataObjects, but since this module is on the SiteTree and uses specific searches I can't get it to work.

  • SamTheJarvis
    Avatar
    Community Member
    24 Posts

    Re: Custom Fields added to Site Search Link to this post

    Have a look at SearchContext, not sure how it relates to the default Site Search.

    http://doc.silverstripe.org/sapphire/en/reference/searchcontext
    &
    http://api.silverstripe.org/2.4/sapphire/search/SearchContext.html

    With this I have managed to search all dataobjects of a certain class, through multiple fields and return a DOset of qualifying DOs, with pagination.

    Don't have the code for it at the moment, but SearchContext is probably what you want to be looking at, was easy enough to edit the given example.

  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    Re: Custom Fields added to Site Search Link to this post

    Hey Terry

    If you are still looking for an answer to your question then I might be able to help.

    Nicolaas

  • Terry Apodaca
    Avatar
    Community Member
    109 Posts

    Re: Custom Fields added to Site Search Link to this post

    Nicolaas,

    I figured out a workaround, probably not the best, but something that worked and was really invisible to the Client. I'd really like to know what you have for a solution though...for future projects.

  • WebGem
    Avatar
    Community Member
    2 Posts

    Re: Custom Fields added to Site Search Link to this post

    This has been an issue for me on several sites. I have not been able to find a reasonable fix for searching custom fields. Any input would be greatly appreciated.

    2217 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.