Reply To: Compatibility with another plugin

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Compatibility with another plugin Reply To: Compatibility with another plugin

#8163
Ernest Marcinko
Ernest Marcinko
Keymaster

Yeah, it appears that the code that andrea provided returns the image code instead of the url, I didn’t notice that. Try this modification instead:

add_filter( 'asp_results', 'asp_get_yith_vendor_data', 1, 1 );
 
function asp_get_yith_vendor_data( $results ) {

  foreach ($results as $k=>$v) {
    if ( $v->content_type == "term" ) {
      if( function_exists( 'YITH_Vendors' ) ){
        $vendor_description = $vendor_logo = '';
        $vendor = yith_get_vendor( $term_id, 'vendor' );
        if( $vendor->is_valid() ){
          $vendor_description = $vendor->description;
          $vendor_logo = get_avatar_url( $vendor->get_owner() );
        }
        $results[$k]->image = $vendor_logo;
        $results[$k]->content = $vendor_description;
      }
    }
  }
 
  return $results;
}
Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)