Add custom page to the vendor dashboard

// Hook into the navigation add_filter( ‘wcv_pro_dashboard_urls’, ‘add_test_page_nav’, 9 ); function add_test_page_nav( $pages ){ $pages[ ‘test_page’ ] = array( ‘slug’ => ‘test_page’, ‘id’ => ‘test_page’, ‘label’ => __( ‘Test Page’, ‘wcvendors-pro’ ), ‘actions’ => array( ‘edit’ => __( ‘New’, ‘wcvendors-pro’…Continue reading

Resetting the Vendor & Pending Vendor Roles

add_filter(‘woocommerce_login_redirect’, ‘redo_roles’, 10, 2); function redo_roles() { remove_role( ‘pending_vendor’ ); add_role( ‘pending_vendor’, __( ‘Pending Vendor’, ‘wcvendors’ ), array( ‘read’ => true, ‘edit_posts’ => false, ‘delete_posts’ => false ) ); remove_role( ‘vendor’ ); add_role( ‘vendor’, ‘Vendor’, array( ‘assign_product_terms’ => true, ‘edit_products’…Continue reading

Override the commission calculation priority order

/** * Given the provided list of vendor_ids in the vendors array, override the commission to use the vendor store commission. * Requires: WC Vendors Pro 1.8.6 or above. */ add_filter( ‘wcvendors_commission_args’, ‘wcv_store_vendor_override’, 10, 4 ); function wcv_store_vendor_override( $commission_args, $product_id,…Continue reading

Make All Users Vendors

/** * Make all new user registrations Vendors. */ add_filter( ‘woocommerce_new_customer_data’, ‘wcv_woocommerce_new_user_data’ ); function wcv_woocommerce_new_user_data( $data ){ $data[‘role’] = ‘vendor’; // the new default role return $data; } /** * Redirect the new registered user to the Vendor Dashboard */…Continue reading

Recent products table

if ( ! function_exists( ‘wcv_remove_recent_product_table_columns’ ) ) { /** * Remove columns from Recent Products table in Pro Dashboard * * @param array $columns Columns of table. * @return array */ function wcv_remove_recent_product_table_columns( $columns ) { //Remove Status column unset(…Continue reading

Remove table from dashboard

if ( ! function_exists( ‘wcv_remove_recent_order_table_columns’ ) ) { /** * Remove columns from Recent Orders table in Pro Dashboard * * @param array $columns Columns of table. * @return array */ function wcv_remove_recent_order_table_columns( $columns ) { //Remove commission column unset(…Continue reading

Add extra shipping providers for vendor tracking numbers

$shipping_providers = array( ‘Australia’ => array( ‘Australia Post’ => ‘https://auspost.com.au/mypost/track/#/details/%1$s’, ‘FedEx’ => ‘https://www.fedex.com/apps/fedextrack/?tracknumbers=%1$s&cntry_code=au’, ‘Fastway Couriers’ => ‘https://www.fastway.com.au/tools/track/?l=%1$s’, ), ‘Austria’ => array( ‘post.at’ => ‘https://www.post.at/sv/sendungsdetails?snr=%1$s’, ‘dhl.at’ => ‘https://www.dhl.at/content/at/de/express/sendungsverfolgung.html?brand=DHL&AWB=%1$s’, ‘DPD.at’ => ‘https://tracking.dpd.de/parcelstatus?locale=de_AT&query=%1$s’, ), ‘Brazil’ => array( ‘Correios’ => ‘http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=%1$s’, ), ‘Belgium’ =>…Continue reading