Last active
February 15, 2018 17:01
-
-
Save amanhstu/fd6c0ca618aa9953625ce235b41af9e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//woocommerce | |
/* | |
Show Seller name on the product thumbnail | |
For WooCommerce | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title','sold_by_vendor_name' ); | |
function sold_by_vendor_name(){ | |
?> | |
</a> | |
<?php | |
global $product; | |
$seller = get_post_field( 'post_author', $product->get_id()); | |
$author = get_user_by( 'id', $seller ); | |
$store_info = dokan_get_store_info( $author->ID ); | |
if ( !empty( $store_info['store_name'] ) ) { ?> | |
<span class="brand-name"> | |
<?php printf( '<a href="%s">%s</a>', dokan_get_store_url( $author->ID ), $store_info['store_name'] ); ?> | |
</span> | |
<?php | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment