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 shipping tab on the product-edit form. | |
add_filter( 'wcv_product_meta_tabs', 'remove_shipping_tab' ); | |
function remove_shipping_tab( $tabs ){ | |
unset( $tabs['shipping'] ); | |
return $tabs; | |
} // remove_shipping_tab() |
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
/* WC Vendors Pro remove add product button pro vendor dashboard */ | |
add_filter('wcv_dashboard_quick_links', 'remove_add_product' ); | |
function remove_add_product( $quick_links ){ | |
unset( $quick_links['product'] ); | |
return $quick_links; | |
} |
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
/* change the label for the seller info wc vendors pro front end settings form */ | |
add_filter('wcv_vendor_seller_info', 'custom_wcv_vendor_seller_info'); | |
function custom_wcv_vendor_seller_info ( $args ){ | |
$args['label'] = 'Profile & Policies'; | |
return $args; | |
} |
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
/* This should be placed in your theme/child theme functions.php. | |
Creates the function for the fields to collect the info, and adds the fields | |
to the front-end store settings page (payments tab) and the admin user page. */ | |
/* ADD FIELD TO FRONT END DASHBOARD / SETTINGS */ | |
add_action( 'wcvendors_settings_after_paypal', 'store_bank_details' ); | |
function store_bank_details( ){ | |
if ( class_exists( 'WCVendors_Pro' ) ){ | |
$key = '_wcv_custom_settings_bankname'; | |
$value = get_user_meta( get_current_user_id(), $key, true ); |
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
// Add this to your themes functions.php to change the order, rearrage the lines. First line is first item, last is last etc. | |
add_filter( 'wcv_dashboard_pages_nav', 'change_nav_order'); | |
function change_nav_order( $pages ){ | |
$new_nav_order = array(); | |
$new_nav_order['product'] = $pages['product']; | |
$new_nav_order['dashboard_home'] = $pages['dashboard_home']; | |
$new_nav_order['order'] = $pages['order']; | |
$new_nav_order['rating'] = $pages['rating']; | |
$new_nav_order['shop_coupon'] = $pages['shop_coupon']; | |
$new_nav_order['settings'] = $pages['settings']; |
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 add to cart on product page if vacation mode is active | |
function IsVacation_product_page(){ | |
$vendor_id = get_the_author_meta('ID'); | |
$vacation_mode = get_user_meta( $vendor_id, '_wcv_vacation_mode', true ); | |
if ($vacation_mode){ | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
} | |
} | |
add_action('woocommerce_single_product_summary','IsVacation_product_page'); |
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
add_action( 'woocommerce_add_order_item_meta', 'bwd_add_vendor_to_order_item_meta', 10, 2); | |
function bwd_add_vendor_to_order_item_meta( $item_id, $cart_item) { | |
$vendor_id = $cart_item[ 'data' ]->post->post_author; | |
// build up address | |
$address1 = get_user_meta( $vendor_id , '_wcv_store_address1', true ); | |
$address2 = get_user_meta( $vendor_id , '_wcv_store_address2', true ); | |
$city = get_user_meta( $vendor_id , '_wcv_store_city', true ); | |
$store_postcode = get_user_meta( $vendor_id , '_wcv_store_postcode', true ); | |
$address = ( $address1 != '') ? $address1 .', ' . $city .', '. $store_postcode :''; | |
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
// Default value for manage stock? = yes | |
add_filter( 'wcv_product_manage_stock', 'change_default_manage_stock' ); | |
function change_default_manage_stock() { | |
$field['post_id'] = $post_id; | |
$field['id'] = '_manage_stock'; | |
$field['wrapper_class'] = 'show_if_simple show_if_variable'; | |
$field['label'] = __( 'Manage stock?', 'wcvendors-pro' ); | |
$field['description'] = __( 'Enable stock management at product level', 'wcvendors-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
/* WC Vendors Pro - changes default product type to Auction (simple auction plugin needed). | |
To be placed in the child theme functions.php */ | |
add_filter( 'wcv_default_product_type', 'wcv_default_product_type_auction' ); | |
function wcv_default_product_type_auction($product_type) { | |
$product_type = 'auction'; | |
return $product_type; | |
} |
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
/* WC Vendors Pro remove store tab on settings page */ | |
add_filter('wcv_store_tabs', 'remove_store_tab' ); | |
function remove_store_tab( $store_tabs ){ | |
unset( $store_tabs['store'] ); | |
return $store_tabs; | |
} |