This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Using the asp_query_args filter to always include products with a specific term

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Using the asp_query_args filter to always include products with a specific term Reply To: Using the asp_query_args filter to always include products with a specific term

#25787
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Paul,

Well, you can try a custom function, that lets you inject SQL queries within the main search query:

add_filter( 'asp_query_args', 'asp_custom_query_args', 10, 2 );
function asp_custom_query_args($args, $search_id) {
	$args['cpt_query'] = array(
		'fields'  => '',
		'join'    => '',
		'where'   => '',
		'orderby' => ''
	);

    return $args;
}

These are replaced in wp-content/plugins/ajax-search-pro/includes/classes/search/class-asp-search-cpt.php file, namely the {args_fields}, {args_join} etc.. pseudo variables.

You might have to directly modify the query within the same file.