Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Last active October 20, 2015 07:52
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 digitalchild/badabf867eaff01a9fb0 to your computer and use it in GitHub Desktop.
Save digitalchild/badabf867eaff01a9fb0 to your computer and use it in GitHub Desktop.
Override the sold by in WC Vendors Pro
<?php
// The following section of code will override the sold by in the loop and product pages
// Change the url to the buddypress call for the user id (i dont know what that is)
add_filter( 'wcv_loop_sold_by', 'vendor_shop_url_update');
add_filter( 'wcv_product_sold_by', 'vendor_shop_url_update');
function vendor_shop_url_update( $args ) {
// Grab the id out of the array so that you can get information about their username.
$vendor_id = $args['vendor_id'];
if ( WCV_Vendors::is_vendor( $vendor_id ) ) {
$args['shop_url'] = 'http://yourlinktobuddypressprofilehere.com';
}
return $args;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment