Skip to content

Instantly share code, notes, and snippets.

@fervous
Created December 19, 2017 04:59
Show Gist options
  • Save fervous/546fb26dc54bc3dd207df141c284db1f to your computer and use it in GitHub Desktop.
Save fervous/546fb26dc54bc3dd207df141c284db1f to your computer and use it in GitHub Desktop.
wc vendors pro add vendor sold by to seller info tab product page
/* sold by product page - seller info tab */
add_action('wcv_before_seller_info_tab', 'sold_by_seller_tab');
function sold_by_seller_tab() {
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
$vendor_id = get_the_author_meta('ID');
$store_url = WCVendors_Pro_Vendor_Controller::get_vendor_store_url( $vendor_id );
$shop_name = get_user_meta( $vendor_id, 'pv_shop_name', true );
$sold_by = '<a href="'.$store_url.'">'.$shop_name.'</a>';
echo '<p>Sold By: '.$sold_by.'</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment