Skip to content

Instantly share code, notes, and snippets.

@fervous
Created July 19, 2017 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fervous/199b00fa508c665265fd76159c2c8302 to your computer and use it in GitHub Desktop.
Save fervous/199b00fa508c665265fd76159c2c8302 to your computer and use it in GitHub Desktop.
add vendor store sold by to product title - below - (second line) wc vendors pro
/* sold by product page - title area */
add_action('woocommerce_single_product_summary', 'sold_by_product_title',6);
function sold_by_product_title() {
$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