Add a document file upload

// Add the document field to the signup form. add_action( ‘wcv_form_input_after__wcv_store_name’, ‘wcv_doc_uploader’); function wcv_doc_uploader( ){ if (‘signup’ == WCVendors_Pro_Store_Form::$form_type ){ echo ‘ ‘; echo ‘ Document Uploader ‘; $value = get_user_meta( get_current_user_id(), ‘_wcv_custom_settings_doc_example’, true ); WCVendors_Pro_Form_Helper::file_uploader( array( ‘id’ => ‘_wcv_custom_settings_doc_example’,…Continue reading

Allow HTML in the product description

function wcv_wpkses_post_html_tags( $tags, $context ) { if ( ‘post’ === $context ) { $tags[‘iframe’] = array( ‘src’ => true, ‘height’ => true, ‘width’ => true, ‘frameborder’ => true, ‘allowfullscreen’ => true, ); } return $tags; } add_filter( ‘wp_kses_allowed_html’, ‘wcv_wpkses_post_html_tags’, 10,…Continue reading

Paid Memberships Pro with WC Vendors

// PAID MEMBERSHIPS PRO — UPGRADE TO VENDOR, DOWNGRADE TO SUBSCRIBER /* Members signing up for membership level #1 get “Vendor” role. Members signing up for membership level #2 get “Vendor” role. Members cancelling are given the customer role. Admin…Continue reading

How to change the store address country for all vendors

/** * Set the vendor’s store country to us. */ function wcv_set_vendor_country() { if ( function_exists( ‘set_time_limit’ ) ) { set_time_limit( 0 ); } $vendor_ids = get_users( array( ‘role__in’ => array( ‘vendor’, ‘pending_vendor’, ), ‘number’ => -1, ‘fields’ => ‘ids’,…Continue reading

Add Vendor Ratings / Feedback to Product Page

add_action(‘woocommerce_before_add_to_cart_form’,’vendor_feedback_product_page’); function vendor_feedback_product_page() { $vendor_id = get_the_author_meta(‘ID’); $vendor_shop = urldecode( get_query_var( ‘vendor_shop’ ) ); if ( ‘yes’ != WCVendors_Pro::get_option( ‘ratings_management_cap’ ) ) { echo WCVendors_Pro_Ratings_Controller::ratings_link( $vendor_id, true ); } }Continue reading

Change Method Label

add_filter( ‘woocommerce_cart_shipping_method_full_label’, ‘wcv_override_vendor_shipping_label’, 10, 2 ); function wcv_override_vendor_shipping_label( $label, $method ){ $label = ‘Flat-rate’; // cost; $hide_cost = ! $has_cost && in_array( $method->get_method_id(), array( ‘free_shipping’, ‘local_pickup’ ), true ); if ( $has_cost && ! $hide_cost ) { if ( WC()->cart->display_prices_including_tax()…Continue reading

Remove Method label

add_filter( ‘woocommerce_cart_shipping_method_full_label’, ‘remove_shipping_method_title’, 10, 2 ); function remove_shipping_method_title( $label, $method ){ $new_label = ”; if ( $method->cost > 0 ) { if ( WC()->cart->tax_display_cart == ‘excl’ ) { $new_label .= wc_price( $method->cost ); if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax…Continue reading

Custom Field to Vendor Settings Page

/* WC Vendors Pro – My Custom Field */ function store_bank_details( ){ if ( class_exists( ‘WCVendors_Pro’ ) ){ $key = ‘_wcv_custom_settings_bankname’; $value = get_user_meta( get_current_user_id(), $key, true ); // Bank Name WCVendors_Pro_Form_Helper::input( array( ‘id’ => $key, ‘label’ => __( ‘Bank…Continue reading