Location: everywhere
Add order status to the commissions table export
/** * Add order status to the commissions table export */ function wcv_commission_export_columns( $columns ){ $columns[‘order_status’] = __(‘Order Status’,’wc-vendors’ ); return $columns; } add_filter( ‘wcv_commissions_export_columns’, ‘wcv_commission_export_columns’, 1 ); /** * Add the order status column data to the csv export…Continue reading
Add order status to commissions table
/** * Add order status to commissions table * * @param Array $columns array stored column names * @return Array $columns */ function wcv_custom_commissions_columns( $columns ) { $columns[‘order_status’] = __( ‘Order Status’, ‘wc-vendors’ ); return $columns; } add_filter( ‘wcvendors_commissions_columns’, ‘wcv_custom_commissions_columns’,…Continue reading
Add a custom column to Commission table
/** * Add custom columns label * * @param Array $columns array stored column names * @return Array $columns */ function custom_commissions_columns( $columns ) { $columns[‘id’] = __( ‘ID’, ‘wc-vendors’ ); return $columns; } add_filter( ‘wcvendors_commissions_columns’, ‘custom_commissions_columns’, 10, 1 );…Continue reading
Commissions as a fixed dollar amount, or fixed plus a percentage.
add_filter( ‘wcv_commission_rate’, ‘my_wcv_custom_filter’, 10, 3 ); function my_wcv_custom_filter( $commission, $product_id, $product_price ) { return WCV_Commission::get_commission_rate( $product_id ); } add_filter( ‘wcv_commission_rate’, ‘my_wcv_commission_rate’, 10, 4 ); function my_wcv_commission_rate( $commission, $product_id, $product_price, $order ) { $per_item_addition = .3; //add $0.30 charge for each…Continue reading
Custom fields to vendor settings page
add_action(‘wcvendors_settings_after_paypal’, ‘pv_add_custom_merchant_id_field’); function pv_add_custom_merchant_id_field() { ?>Continue reading
Redirecting Vendors to Vendor Dashboard on Login
add_filter(‘woocommerce_login_redirect’, ‘login_redirect’, 10, 2); function login_redirect( $redirect_to, $user ) { // WCV dashboard — Uncomment the 3 lines below if using WC Vendors Free instead of WC Vendors Pro if (class_exists(‘WCV_Vendors’) && WCV_Vendors::is_vendor( $user->;ID ) ) { $redirect_to = get_permalink(…Continue reading
Single Vendor Purchase
// Limit checkout to a single vendor store add_action( ‘woocommerce_add_to_cart_validation’, ‘limit_single_vendor_to_cart’, 10, 3 ); function limit_single_vendor_to_cart( $valid, $product_id, $quantity ) { $vendor_id = get_post_field( ‘post_author’, $product_id ); // loop through the cart to check each vendor id foreach ( WC()->cart->get_cart()…Continue reading
Product Expiry For Woo
/** * Add support for Product Expiry for WooCommerce Plugin */ if ( class_exists( ‘WOO_Product_Expiry’) ){ /** * Add fields to the product edit form under prices */ function wcv_pefwc_add_fields( $post_id ){ // Expiry date field. $expiry_date = get_post_meta( $post_id,…Continue reading
Download Manager
/** * Stop Download Manager frontend script from loading on the Pro dashboard. * */ function wcv_dequeue_wpdm_script() { $dashboard_page_id = (array) get_option( ‘wcvendors_dashboard_page_id’, array() ); foreach ( $dashboard_page_id as $page_id ) { if ( is_page( $page_id ) ) { wp_dequeue_script(…Continue reading