Guest User

Untitled

a guest
Oct 15th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'woocommerce_single_product_summary', 'seller_name_on_single', 11 );
  4. function seller_name_on_single(){
  5. global $product;
  6. $seller = get_post_field( 'post_author', $product->get_id());
  7. $author = get_user_by( 'id', $seller );
  8.  
  9. $store_info = dokan_get_store_info( $author->ID );
  10.  
  11. if ( !empty( $store_info['store_name'] ) ) { ?>
  12. <span class="details">
  13. <?php printf( 'Sold by: <a href="%s">%s</a>', dokan_get_store_url( $author->ID ), $author->display_name ); ?>
  14. </span>
  15. <?php
  16. }
  17. }
  18. ?>
Add Comment
Please, Sign In to add comment