Hi,
I want to search my products through _msku and _ean but I couldn’t find the related portion in your code where you wrote the logic for ajax search.
I am able to do a normal search without a problem with:
function custom_search_where($where){
global $wpdb;
if (is_search()) {
$search_query = get_search_query();
$where .= " OR (" . $wpdb->posts . ".ID IN (
SELECT post_id
FROM " . $wpdb->postmeta . "
WHERE (meta_key = '_sku' OR meta_key = '_msku' OR meta_key = '_ean')
AND meta_value LIKE '%" . $search_query . "%'))";
}
return $where;
}
add_filter('posts_where', 'custom_search_where');
Could you please point me to write portion of your code so I can edit it to take _ean and _msku into account.