Last active
May 17, 2017 01:38
-
-
Save fervous/da688a5e8af7f61b73936add5036446b to your computer and use it in GitHub Desktop.
Remove "sold by" on Product Page-- add new Message WC Vendors Pro
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
/* 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