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
// SEO Overwrite meta description for vendor pages | |
function overwrite_vendor_meta($desc) { | |
// Return the default value if we're not on a vendor shop page | |
if(!WCV_Vendors::is_vendor_page()) return $desc; | |
// Get the vendor description and return it | |
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) ); | |
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); | |
$desc = get_user_meta( $vendor_id, 'pv_shop_description', 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
/* Default value for manage stock = checked */ | |
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
/*Remove International Shipping Charge Field */ | |
add_filter( 'wcv_shipping_international_fee', 'hide_wcv_shipping_international_fee' ); | |
function hide_wcv_shipping_international_fee( $field ) { | |
$field['label'] = __( '' ); | |
$field['description'] = __( '' ); | |
$field['type'] = 'hidden'; | |
$field['value'] = 'no'; | |
return $field; | |
} |
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
/* adds a a new quicklink to pro vendor dashboard */ | |
add_filter('wcv_dashboard_quick_links', 'new_wcv_dashboard_quick_link'); | |
function new_wcv_dashboard_quick_link($quick_links ){ | |
$quick_links[] = array( 'label' => 'Name of Link Here', 'url' => 'http://test.dev/my-account' ); | |
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
/* WC Vendors Pro Change title Length Req. on Product Page */ | |
add_filter('wcv_product_title', 'wcv_product_title_req'); | |
function wcv_product_title_req( $args ){ | |
$args['custom_attributes']['data-rules'] = 'required|max_length[200]'; | |
return $args; | |
} | |
/* WC Vendors Pro Change title Length Req. Message on Product Page */ | |
add_filter('wcv_product_title', 'wcv_product_title_req_error'); | |
function wcv_product_title_req_error( $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
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 this to your child theme functions.php */ | |
add_filter ('wcvendors_vendor_registration_checkbox', 'custom_wcvendors_vendor_registration_checkbox'); | |
function custom_wcvendors_vendor_registration_checkbox () { | |
$message = 'new apply text here'; | |
return $message; | |
} |
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
function add_custom_info_field() { | |
WCVendors_Pro_Form_Helper::input ( array( | |
'id' => 'custom_info_message', | |
'placeholder' => __( 'add a message ...'), | |
'value' => $value | |
) | |
); | |
} | |
add_action( 'woocommerce_after_add_to_cart_button', 'add_custom_info_field' ); |
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 | |
/** | |
* The template for displaying the Downloadable Product Edit form | |
* | |
* Override this template by copying it to yourtheme/wc-vendors/dashboard/ | |
* | |
* @package WCVendors_Pro | |
* @version 1.5.5 | |
*/ | |
/** |
NewerOlder