Osclass Support Forums

Osclass theme support => Beta Osclass Theme => Topic started by: trademark on December 27, 2021, 01:19:40 PM

Title: Search custom field values
Post by: trademark on December 27, 2021, 01:19:40 PM
Hello,

I have created multiple custom fields for the categories in my project. I noticed that the search works only if the searched word is in the title or description of the listing. How can I make the search to work for the values of custom fields?
For example, I have a select box custom field named Brand with values Brand1, Brand2, Brand3. If I search by the word Brand2 in the search box on the homepage I want to get all the listings for which Brand2 value is selected for the field Brand.

Thank you!
Title: Re: Search custom field values
Post by: MB Themes on December 27, 2021, 02:43:18 PM
It is required to add t_item_meta table into search and instead of sPattern use some different input name like sKeyword that will filter on all required tables.

If you check functions.php, it already extend search capabilities, you might get inspired.
Title: Re: Search custom field values
Post by: trademark on January 03, 2022, 02:02:37 PM
Not sure I got it, can you be more specific, please?
Title: Re: Search custom field values
Post by: MB Themes on January 04, 2022, 06:53:46 AM
@trademark
This can be used as reference:
https://forums.osclasspoint.com/backoffice-manager-plugin/(help)-will-this-conflict-with-'improve-search-for-premium'/msg4108/#msg4108
https://forums.osclasspoint.com/zara-osclass-responsive-theme/search-problem/msg17704/#msg17704