Get Blog Info

/** * Function that returns a value from the get_bloginfo() function with a prefix, suffix, and separator. * * @param string $blog_info The blog info to be retrieved. Example: ‘name’, ‘description’, etc. * @param string $prefix The prefix to add…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

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