How to showWCFM vendor store in search ?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to showWCFM vendor store in search ?

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36623
    rifatspir96
    rifatspir96
    Participant

    Thanks for recently helping me to show dokan plugin vendor store in search result. I have switched to WCFM and it use different way to vendor image. I cant see any Custom field containing the image option for users. Can you provide me any custom code to show the vendor image? Thanks

    Here’s the ss https://ibb.co/b6Lqjk1

    • This topic was modified 2 years, 2 months ago by rifatspir96 rifatspir96.
    #36632
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    For that I will need to know how that image is stored, and how to access it. Does that plugin has any documentation or API for retrieving the images?

    Best,
    Ernest Marcinko

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


    #36684
    rifatspir96
    rifatspir96
    Participant

    yes here is the plugin url and api guide

    https://wordpress.org/plugins/wc-frontend-manager/

    https://wclovers.github.io/wcfm-rest-api/#introduction

    If you need i will give access to my site

    #36692
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Fantastic, I have found this from their support forums, which I think has a solution for us.

    Try this:

    add_filter( 'asp_results', 'asp_get_custom_wcfm_vendor_image', 10, 1 );
    function asp_get_custom_wcfm_vendor_image( $results ) {
    	foreach ($results as $k=>&$r) {
    		if ( $r->content_type == 'user' ) {
    			$store = wcfmmp_get_store( $r->id);
    			$img = $store->get_avatar();
    			if ( !is_wp_error($img) && !empty($img) )
    				$r->image = $img;
    		}
    	}
    	return $results;
    }
    Best,
    Ernest Marcinko

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


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.