0

i implemented the store name beside the product by implementing this code

    /*
Show Store name on the product thumbnail For Dokan Multivendor plugin 
*/

  add_action( 'woocommerce_after_shop_loop_item_title','sold_by' );
    function sold_by(){
    ?>
        </a>
        <?php
            global $product;
            $seller = get_post_field( 'post_author', $product->get_id());
            $author  = get_user_by( 'id', $seller );
            $vendor = dokan()->vendor->get( $seller );

            $store_info = dokan_get_store_info( $author->ID );
            if ( !empty( $store_info['store_name'] ) ) { ?>
                    <span class="details">
                        <?php printf( 'Sold by: <a href="%s">%s</a>', $vendor->get_shop_url(),  $vendor->get_shop_name() ); ?>
                    </span>
            <?php 
        } 

    }
?>

But I wanted to show the store profile Picture Below the Product Title name

1 Answers1

0

You can just simply get user avatar using wp function get_avatar_url( mixed $id_or_email, array $args = null ) check here

Amir
  • 41
  • 3