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

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 ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36623
    rifatspir96rifatspir96
    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 4 years, 3 months ago by rifatspir96rifatspir96.
    #36632
    Ernest MarcinkoErnest 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?

    #36684
    rifatspir96rifatspir96
    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 MarcinkoErnest 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;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.