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

Reply To: 3 questions: author field, layout organization, and more!

Home Forums Product Support Forums Ajax Search Pro for WordPress Support 3 questions: author field, layout organization, and more! Reply To: 3 questions: author field, layout organization, and more!

#40219
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Jon,

The vendor results are taxonomy terms if I understand correctly, and you would like to display associated term metadata with them. I’m afraid there is not option to do that. The only option is to use custom code, but it is not very easy, you will have to know the meta keys and construct a custom code. This is the base code I recommend:

add_filter('asp_results', 'asp_get_term_metadata');
function asp_get_term_metadata($results) {
    $keys = array("meta_key1", "meta_key2");
    
    foreach($results as $k=>&$r){
        if ( $r->content_type == 'term' && empty($r->image) ) {
			foreach ( $keys as $key ) {
				$value = get_term_meta( $r->id, $key, true );
				if ( !empty($value) ) {
					$r->content .= ' ' . $value;
				}
			}
        }
    }
    return $results;
}

The $keys array should contain the term meta names – these should be the keys for the location etc.. The code then fetches the values and appends them to the content field.

Unfortuantely filtering by geolocation/proximity is not possible.