Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Last active September 28, 2017 09:39
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 bentasm1/1c881f7b0e0e85dd8100 to your computer and use it in GitHub Desktop.
Save bentasm1/1c881f7b0e0e85dd8100 to your computer and use it in GitHub Desktop.
Remove Sold By in WC Vendors for various locations
/* Remove sold by in product loops */
remove_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9, 2);
/* Remove sold by in cart view */
remove_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 );
/* Remove sold by on single product pages */
remove_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
/* Remove sold by in emails */
remove_filter( 'woocommerce_order_product_title', array( 'WCV_Emails', 'show_vendor_in_email' ), 10, 2 );
/* Remove the entire seller info tab */
remove_filter( 'woocommerce_product_tabs', array( 'WCV_Vendor_Shop', 'seller_info_tab' ) );
/* Remove from order item meta (required to remove if removing from emails too) */
remove_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );
/* For WC Vendors Pro v1.0.3 and above */
remove_action( 'woocommerce_after_shop_loop_item', array( $wcvendors_pro->wcvendors_pro_store_controller, 'loop_sold_by'), 8 );
remove_action( 'woocommerce_product_meta_start', array( $wcvendors_pro->wcvendors_pro_store_controller, 'product_sold_by'), 8);
remove_filter( 'woocommerce_get_item_data', array( $wcvendors_pro->wcvendors_pro_store_controller, 'cart_sold_by' ), 8, 2 );
@digitalchild
Copy link

Missed an action.

// Remove vendor from all sales related invoices
remove_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );

@bentasm1
Copy link
Author

Updated! Thanks.

@Ib-R
Copy link

Ib-R commented Sep 28, 2017

i tried it but it didn't remove sold by from the Order Details or the Email, does it need an update ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment