Archives: Snippets
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
Custom WooCommerce Status
** * Register new post status with WordPress */ add_action( ‘init’, ‘wcvendors_custom_status_action’ ); function wcvendors_custom_status_action() { register_post_status( ‘wc-custom-status’, array( ‘label’ => __( ‘Custom Status’, ‘wc-vendors’ ), ‘public’ => true, ‘show_in_admin_status_list’ => true, ‘label_count’ => _n_noop( ‘Custom Status (%s)’, ‘Custom Status…Continue reading
Change product edit tab order 2
add_filter( ‘wcv_product_meta_tabs’, ‘wcv_change_product_tab_order_alphabetical’ ); function wcv_change_product_tab_order_alphabetical( $tabs ){ ksort( $tabs ); return $tabs; }Continue reading
Change product edit tab order
add_filter( ‘wcv_product_meta_tabs’, ‘wcv_change_product_tab_order_manual’ ); function wcv_change_product_tab_order_manual( $tabs ){ WC_Vendors::log( array_keys( $tabs ) ); $new_tabs = array(); $new_tabs[ ‘general’ ] = $tabs[ ‘general’ ]; $new_tabs[ ‘seo’ ] = $tabs[ ‘seo’ ]; $new_tabs[ ‘shipping’ ] = $tabs[ ‘shipping’ ]; $new_tabs[ ‘inventory’ ]…Continue reading
Enable Full WP_Editor on Product Fields
add_filter( ‘wcv_product_description_editor_settings’, ‘wcv_full_editor’ ); add_filter( ‘wcv_product_short_description_editor_settings’, ‘wcv_full_editor’ ); function wcv_full_editor( $settings ){ $settings[‘teeny’] = false; return $settings; }Continue reading
Allow WooCommerce Shop Managers to manage vendors
/* Lets Shop Managers edit users with these user roles */ function wcv_allow_shop_manager_role_edit_capabilities( $roles ) { $roles[] = ‘vendor’; // insert the role you want them to be able to access here, copy+paste this line for additional user roles return…Continue reading
Add menu item to vendor dashboard
// Add this to your themes functions.php function add_menu_item( $pages ){ $pages[] = array( ‘label’ => ‘Help’, ‘slug’ => ‘http://wcvendors.com/support’, ‘actions’ => array() ); return $pages; } add_filter( ‘wcv_pro_dashboard_urls’, ‘add_menu_item’ );Continue reading