Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active May 17, 2017 01:38
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/da688a5e8af7f61b73936add5036446b to your computer and use it in GitHub Desktop.
Save fervous/da688a5e8af7f61b73936add5036446b to your computer and use it in GitHub Desktop.
Remove "sold by" on Product Page-- add new Message WC Vendors Pro
/* Remove sold by on single product pages */
remove_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
/* Add new message */
add_action('woocommerce_product_meta_start', 'custom_woocommerce_product_meta_start_view');
function custom_woocommerce_product_meta_start_view() {
$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 );
$sold_by = '<a href="'.$store_url.'">Show more products from this vendor</a>';
echo $sold_by;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment