This topic has 2 replies, 2 voices, and was last updated 2 months ago ago by Jack Richardson
Hello,
I’m trying to include product attribute in the search query but with no luck.
I placed this code in functions.php:
add_filter('etheme_ajax_search_products_query', function ($args) {
$term = get_term_by('name', $args['s'], 'pa_brand-identifier');
$brand_id_args = array(
'taxonomy' => 'pa_brand-identifier',
'operator' => 'IN',
);
if ($term) {
$brand_id_args['terms'] = array($term->term_id);
array_push($args['tax_query'], $brand_id_args);
$args['tax_query']['relation'] = 'OR';
}
return $args;
});
Note: I tried with the slug field as well.
Am I doing something wrong?
Regards
Dear @emin,
Thank you for reaching out to us.
Unfortunately, the feature you are requesting is not available by default and would require specific customization codes to be implemented.
Should you require personalized customization services, we kindly invite you to submit a request through our customization panel at the following link: https://www.8theme.com/account/#etheme_customization_panel. This will enable direct engagement with our technical team.
Please be advised that customization services incur additional charges. The exact cost will be determined after a detailed review of your request.
OR Please post your request on our Taskboard at https://www.8theme.com/taskboard/ -If it receives enough votes from other customers, our development team will consider adding it in one of the upcoming updates.
Additionally, You can try to use third-party search plugins that include the desired functionality.
We don’t give a guarantee for full theme compatibility with all 3-rd party plugins.
Thank you for your understanding.
Best regards,
Jack Richardson
The 8Theme Team.
You must be logged in to reply to this topic.Log in/Sign up