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 additional details tab from product page */ | |
add_filter( 'woocommerce_product_tabs', 'custom_remove_product_tabs', 98 ); | |
function custom_remove_product_tabs( $tabs ) { | |
unset( $tabs['additional_information'] ); | |
return $tabs; | |
} |
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_filter( 'wcv_commission_rate', 'my_wcv_commission_rate', 10, 4 ); | |
function my_wcv_commission_rate( $commission, $product_id, $product_price, $order ) { | |
$product = wc_get_product($product_id); | |
$commission_amount = get_post_meta( $product_id, 'wcv_commission_amount', true ); | |
$items = $order->get_items(); | |
foreach( $items as $item ) { | |
$booking_ids = WC_Booking_Data_Store::get_booking_ids_from_order_item_id( $item->get_id() ); | |
foreach( $booking_ids as $booking_id ) { | |
$booking = new WC_Booking($booking_id); |
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 to your theme or child theme functions.php file to create a new field on the vendor add-edit product form */ | |
add_action( 'wcv_product_options_general_product_data', 'wcv_custom_product_msrp_price_field' ); | |
function wcv_custom_product_msrp_price_field ($post_id) { | |
WCVendors_Pro_Form_Helper::input( array( | |
'post_id' => $post_id, | |
'id' => '_wcv_custom_product_msrp_price', | |
'label' => __( 'MSRP Price', 'wcvendors-pro' ), | |
'placeholder' => __( 'MSRP Price', 'wcvendors-pro' ), | |
'desc_tip' => 'true', | |
'description' => __( 'Please specify MSRP Price', '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
/* change the label for the price wc vendors pro front end add/edit product form */ | |
add_filter('wcv_product_price', 'custom_wcv_product_price'); | |
function custom_wcv_product_price ( $args ){ | |
$args['label'] = '<strong>WHOLESALE PRICE</strong><br><i class="fa fa-info-circle" aria-hidden="true"></i> <small>Choose a price in USD $ <strong>WITHOUT</strong> currency symbols</small>'; | |
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
<?php | |
/** | |
* This code will disable add product functionality until the stripe connected account is active for the vendor. This will also disable quick links on the main dashboard page. | |
* | |
*/ | |
// Only enable if the Stripe gateway is actually active | |
if ( class_exists('WC_Gateway_Stripe_Connect') ) { | |
// Hook into the dashboard | |
add_action( 'wcv_pro_before_dashboard', 'add_stripe_notice' ); | |
function add_stripe_notice( ){ |
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
<?php | |
/** | |
* This code will disable add product functionality until the stripe connected account is active for the vendor. This will also disable quick links on the main dashboard page. | |
* | |
*/ | |
// Only enable if the Stripe gateway is actually active | |
if ( class_exists('WC_Gateway_Stripe_Connect') ) { | |
// Hook into the dashboard |
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 add product button / label */ | |
add_filter('wcv_dashboard_quick_links', 'change_add_product'); | |
function change_add_product( $quick_links ){ | |
if ( array_key_exists('product', $quick_links ) ) $quick_links[ 'product' ][ 'label' ] = 'new label here'; | |
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 vendor to seller */ | |
add_filter( 'gettext', 'wcv_translate_vendor', 999 ); | |
function wcv_translate_vendor( $translated ) { | |
$translated = str_ireplace( 'vendor', 'seller', $translated ); | |
return $translated; | |
} |
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
/* New City Label and Placeholder */ | |
add_filter('wcv_vendor_store_city', 'custom_wcv_vendor_store_city'); | |
function custom_wcv_vendor_store_city( $args ){ | |
$args['label'] = 'New Label Here'; | |
$args['placeholder'] = 'New Placeholder Here'; | |
return $args; | |
} | |
/* New State Label and Placeholder */ | |
add_filter('wcv_vendor_store_state', 'custom_wcv_vendor_store_state'); |
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
/* attribute(s) to option(s) */ | |
add_filter( 'gettext', 'wcv_translate_attributes', 999 ); | |
function wcv_translate_attributes( $translated ) { | |
$translated = str_ireplace( 'attributes', 'Options', $translated ); | |
return $translated; | |
} | |
add_filter( 'gettext', 'wcv_translate_attribute', 999 ); | |