WooCommerce B2B Sales Agents

Current version: 1.1.0



Introduction
Get started with WooCommerce B2B Sales Agents, the best seller WordPress plugin to manage sales agents network.

WooCommerce B2B Sales Agents is a WordPress/WooCommerce extension that add to your website the capability to have sales agents and calculate their commissions.

In a single suite, all the features that an e-commerce can require to open its horizons to sales agents.

You can find an always updated version of this documentation here.

Requirements
Before starting, check that you have the minimum characteristics to ensure the correct functioning of WooCommerce B2B Sales Agents.

  • WordPress: version 5.0 or above
  • WooCommerce: version 4.0 or above
  • PHP: version 5.6 or above
Installation
There are multiple ways to install WooCommerce B2B Sales Agents, here is a quick step-by-step guide to do this.

Manual mode
  1. Unzip "woocommerce-b2b-sales-agents.zip" file
  2. Login in your FTP area
  3. Upload the entire "woocommerce-b2b-sales-agents" folder to the "/wp-content/plugins/" directory
  4. Login in your WordPress site
  5. Go to "Plugins > Installed Plugins" page
  6. Click "Activate" link at WooCommerce B2B Sales Agents
Classic WordPress mode
  1. Login to your WordPress Dashboard
  2. Go to "Plugins > Add New" page
  3. Click "Upload Plugin" button at the top
  4. Select "woocommerce-b2b-sales-agents.zip" file and click "Install now" button
  5. Once installed, click "Activate" link

Update

To install new release, simply download it from your Envato account, unzip the archive and replace the entire folder:

  • wp-content/plugins/woocommerce-b2b-sales-agents/

with the new one by using an FTP client (such as FileZilla).

Note: Don't uninstall the previous version! By uninstalling you will lose all plugin related settings.
Note: Before to update, please read carefully changelog and this documentation, to verify the changes of new release.
Note: Before to update to latest version, please be sure to have a complete backup (filesystem and database) to avoid any problems or errors.
Note: Before to update to latest version, please be sure to have a complete backup (filesystem and database) to avoid any problems or errors.

Update database process

By updating the plugin to a new release, you will be prompted to perform a database update.
This update is necessary for the correct functioning of the new release, so it is strongly recommended to do it.

All processes to be performed for the update are performed in the background and can be viewed in the WordPress section dedicated to scheduled actions:

Tools -> Scheduled Actions

and associated with the hook wcb2bsa_run_update_callback.


Plugin options
WooCommerce B2B Sales Agents introduces a large number of features, here a complete list with description to guide you in the configuration.

Settings page Settings
WooCommerce > Settings > Sales Agents > Settings tab

Sales agent in emails

Description

Add sales agent data (name, email, phone) in transactional emails, to simplify the contact between the customer and the reference sales agent.

Screenshots

  • Processing order email
Apply commission to

Description

Choose what to apply the commission to. By changing this option, only the next orders will be affected. You can customize this option for each order on order edit page.

Customization

You can customize redirect by using dedicated hooks:

Only direct orders

Description

Consider only orders placed directly from sales agent.

In his dashboard, sales agent can view only orders placed directly by him. Orders placed from his customers are excluded from counts, statistics, commissions calculation.

Edit customer data

Description

Allow sales agents to edit customer account and addresses data in checkout and in my-account pages when switched on his account.

Screenshots

  • Checkout page
  • Edit address page
Edit prices in cart

Description

Allow sales agents to edit and adjust product price in cart page when make purchase in behalf of their customers.

Screenshots

  • Cart page
  • Admin order page
Customization

You can customize cart price arguments input field by using dedicated hooks:

Orders commission column

Description

Add a new commissions column in WooCommerce orders list. In case of a large number of orders or on poorly performing servers, it may slow down the page loading, therefore it is advisable to disable this option in case of excessive slowdowns or out of memory problems in "WooCommerce -> Orders" page.

Screenshots

  • Admin orders page
Customization

You can customize cart price arguments input field by using dedicated hooks:

Default sales agent

Description

Assign automatically customer to a sales agent on registration. Also available these special options:

  • Random: assign a random sales agent among those available
  • Allow to choose: add a dropdown menu in checkout, so guest customers or customers without a sales agent can choose sales agent among those available

Screenshots

  • Checkout page
Sales agents dashboard page

Description

Choose base page for your sales agents dashboard area.

On new installations, WooCommerce B2B Sales Agents automatically create a new page named "Sales agents dashboard" as draft with the proper shortcode [woocommerce_my_account]. To enable, simply publish it.

On updated versions, WooCommerce B2B Sales Agents leave by default sales agents on myaccount page, so you can change this only if you prefer.

Screenshots

  • Sales agents dashboard page
Enable affiliation

Description

Create an unique affiliation link (displayed in the sales agent dashboard) for each sales agents. When a customer uses the affiliate link to register an account, his profile will be assigned to the agent who owns used affiliate link.

Screenshots

  • Sales agent area
Customization

You can customize affiliation link by using dedicated hooks:

New customers

Description

Allow sales agents to create new customers, that will be automatically assigned to him.

Screenshots

  • Sales agent area
  • Sales agent area (modal)
Extended new customer form

Description

Extends new customer form adding checkout billing fields.

Note: all additional fields are considered not required. You can customize this behaviour by using proper hook.
Customization

You can customize redirect by using dedicated hooks:

Screenshots

  • Sales agent area
Update order status

Description

Allow sales agents to update their customers order status.

Screenshots

  • Sales agent area
  • Sales agent area (modal)
Enable widgets

Description

Allow select widgets to enable and display to sales agents.

Screenshots

  • Sales agents dashboard
Enable charts

Description

Allow select charts to enable and display to sales agents.

Screenshots

  • Sales agents dashboard
Endpoints settings

Description

Allow to change sales agents area endpoint slugs.


Settings page Status
WooCommerce > Settings > Sales agents > Status tab

Templates override

Description

Summary of templates status, with a list of templates overridden by your parent/child theme and a warning message that they need to be updated.

Screenshots

  • Status tab

Customizer
Appearance > Customize > WooCommerce B2B Sales Agents

Sales agents area logo

Description

You can upload your personal logo to display in sales agents area.

Screenshots

  • Admin customizer

Product page
Products > All Products > {Product}

Product dedicated commissions

Description

Set for each product custom commissions according to sales agent.

Screenshots

  • Admin product page

Coupons
WooCommerce > Coupons > {Coupon}

Allowed sales agents

Description

Allow coupon usage to customers assigned to selected sales agents. No sales agents selected means no restrictions.

Screenshots

  • Admin coupons page

Customer page
Users > All Users > {User}

Customer sales agent

Description

Assign a sales agent to customer.

Screenshots

  • Admin user page
Global commissions

Description

Assign a global commission to sales agent that will be apply on each purchase.

Note: if product dedicated commission is set, it will override global commission on the product.
Screenshots

  • Admin user page
Send order notification

Description

If enabled, sales agent will receive new order notification when an assigned customer make a purchase.

Screenshots

  • Admin user page
Sales agent customers default group (*)

Description

Assign automatically customer to a B2B group when sales agent register a new customer account. Also available these special options:

  • Allow to choose: add a dropdown menu in registration form, sales agents can choose group among those available

Screenshots

  • Admin user page
(*) Note: this option will appear only if WooCommerce B2B plugin is installed and active.

Order page
WooCommerce > Orders > {Order}

Order sales agent

Description

Assign or change order sales agent.

Screenshots

  • Admin order page
Apply commission to

Description

Choose or change what to apply the commission to.

Screenshots

  • Admin order page
Order created by

Description

When a new order is placed, WooCommerce B2B Sales Agents establishes whether the order was placed by admin, or directly by the customer, or by the sales agent on behalf of the customer. It is possible to change this data.

Screenshots

  • Admin order page

Notification page
WooCommerce B2B Sales Agents > Notifications > {Notification}

Notification

Description

Create all the notifications you want to communicate with your sales agents and notify them of new offers, discounts, coupons etc.

Each notification can be assigned to one or more sales agents.

Screenshots

  • Admin notification page

Commissions page
WooCommerce B2B Sales Agents > Commissions

Commissions

Description

Here a filterable list of all commissions assigned to your sales agents.

You can set each commission as paid/unpaid to better manage your network.

Screenshots

  • Admin commissions page

Import/Export tools
Products > All Products

Product Import/Export tools

Description

Bulk update product commissions. WooCommerce B2B Sales Agents extends default WooCommerce Import/Export tools to allow to fast manage its custom data.

Note: to know more about WooCommerce Import/Export tools, please read Official documentation.
Screenshots

  • Admin products page
  • Import page

WordPress Export tools
Tools > Export

Commissions export

Description

Allow to export commissions list in CSV file to statistics purposes.

Screenshots

  • Admin export tools page

WooCommerce reports
WooCommerce > Reports

Sales by sales agent

Description

Summarize sales grouped by sales agent, with total orders amount and total orders count.

Screenshots

  • Admin reports page
How to translate
Translate WooCommerce B2B Sales Agents is very simple.

WooCommerce B2B Sales Agents is already provided in two language: English and Italian.

All plugin strings have been localized using the GNU gettex framework to make it completely "translation ready", so it can be easly translated in the same way that other WordPress plugins.

Find out if WooCommerce B2B Sales Agents is available in your desired language, thanks to the collaboration of our fantastic users: Language packs.

This is a simple guide to translate WooCommerce B2B Sales Agents in the language of your choice.


Get a useful software: POEDIT

WordPress, with all its themes and plugins, based translations on GNU gettex framework, that use three types of files:

  • PO (Portable Object) files
  • MO (Machine Object) files
  • POT (Portable Object Template) files

The first step is to get a translation tool able to manage this kind of files; there are many ones available, but I suggest without doubt Poedit.

Poedit is a free open source software, easy to use and available for MacOSX, Windows, Linux and you can download it from here: https://poedit.net/download.


Translating with POEDIT

Create a new translation with Poedit is very simple, here a step-by-step guide to help you to make it.

  1. Install Poedit
  2. Open Poedit and go to:
    File -> New from POT/PO file
  3. In the popup box that appears, navigate into WooCommerce B2B Sales Agents folder and select the file:
    woocommerce-b2b-sales-agents/i18n/woocommerce-b2b-sales-agents.pot
  4. When the file is loaded, another box will pop up asking for the language you want to translate:
    Choose your language
  5. String by string, enter your translation in the Translate box at bottom.

When finished, validate your translation and save the file, named as: woocommerce-b2b-sales-agents-it_IT. The name pattern is composed by:

  • woocommerce-b2b-sales-agents: the plugin domain name, usually the plugin folder name (as described in WordPress i18n standards)
  • it: the GNU language code
  • IT: the GNU country code

Use your translation

After saving, Poedit will create two files:

  • woocommerce-b2b-sales-agents-it_IT.po
  • woocommerce-b2b-sales-agents-it_IT.mo

Your translations are ready! To use them, you just have to move them into the folder:

  • wp-content/languages/plugins/

Now, go to your website and WooCommerce B2B Sales Agents is finally translated in your language!


More informations

For more informations about language and country codes, please refer to:

For more informations about GNU gettex utilities and WordPress i18n, please refer to:

Note: if you want to contribute to WooCommerce B2B Sales Agents internationalization, please send your PO file to: support@woocommerce-b2b.com.
Plugin Hooks
WooCommerce B2B Sales Agents provide large number of hooks to allow developers to extends or customize default behaviour.

If you are a developer, WooCommerce B2B Sales Agents give you many possible customizations by using the hooks. To know more about WordPress hooks working, please read Plugin API/Hooks WordPress Codex.

As WordPress best practice, we suggesto to make use of a WordPress Child Theme to avoid losing customizations in case of theme update. To know more about WordPress Child Theme, take alook to Child Themes WordPress Codex.

Here the list of WooCommerce B2B Sales Agents hooks:

Custom roles management

Description

WooCommerce B2B Sales Agents apply some own rules and functions only to default WooCommerce customer role and other functions only to sales_agent role. With this hook, you can extend these functions behaviour to custom roles.

Definition
apply_filters( 'wcb2bsa_has_role_customer', array $roles );
apply_filters( 'wcb2bsa_has_role_sales_agent', array $roles );
Defaults
$roles = array( 'customer' );
$roles = array( 'sales_agent' );
Example

To extend WooCommerce B2B Sales Agents sales agents role functions to a new custom role called "mycustomrole", you can add this code to your functions.php file:

add_filter( 'wcb2bsa_has_role_sales_agent', 'fn_wcb2bsa_has_role_sales_agent' );
function fn_wcb2bsa_has_role_sales_agent( $roles ) {
    $roles[] = 'mycustomrole';
    return $roles;
}
Dashboard widgets

Description

Customize sales agents dashboard by adding, modifying or removing widgets.

Definition
apply_filters( 'wcb2bsa_dashboard_widgets', array $widgets );
Example

To change "Current commission percentage" label, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_dashboard_widgets', 'fn_wcb2bsa_dashboard_widgets' );
function fn_wcb2bsa_dashboard_widgets( $widgets ) {
    $widgets['widgets']['current_commissions']['label'] = __( 'New label', 'woocommerce-b2b-sales-agents' );
    return $widgets;
}

To remove "Pending commission value" widget, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_dashboard_widgets', 'fn_wcb2bsa_dashboard_widgets' );
function fn_wcb2bsa_dashboard_widgets( $widgets ) {
    unset( $widgets['widgets']['pending_commissions'] );
    return $widgets;
}

Here available widgets and charts:

  • $widgets['widgets']['current_commissions'] -> Current commission percentage
  • $widgets['widgets']['paid_commissions'] -> Paid commission value
  • $widgets['widgets']['pending_commissions'] -> Pending commission value
  • $widgets['widgets']['managed_customers'] -> Managed customers number
  • $widgets['widgets']['total_orders'] -> Total orders number
  • $widgets['widgets']['total_amount'] -> Total orders value
  • $widgets['stats']['customers'] -> Customers chart
  • $widgets['stats']['commissions'] -> Commissions chart
  • $widgets['stats']['orders'] -> Orders chart
Statistics

Description

Customize sales agents statistics parameters and data.

Definition
apply_filters( 'wcb2bsa_stats_params', array $params );
Example

To change chart bar (line) color, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_stats_params', 'fn_wcb2bsa_stats_params' );
function fn_wcb2bsa_stats_params( $params ) {
    $params['data']['datasets'][0]['backgroundColor'] = 'rgba( 255, 0, 0, 0.5 )';
    return $params;
}

To know more about parameters, please refer to: ChartJS documentation.

CSS styles

Description

Customize sales agents area by adding, modifying or removing styles.

Definition
apply_filters( 'wcb2bsa_myaccount_styles', array $styles );
Example

To add a new style, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_styles', 'fn_wcb2bsa_myaccount_styles' );
function fn_wcb2bsa_myaccount_styles( $styles ) {
    $styles['style-name'] = 'style-url';
    return $styles;
}

To remove "Font Awesome" style, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_styles', 'fn_wcb2bsa_myaccount_styles' );
function fn_wcb2bsa_myaccount_styles( $styles ) {
    unset( $styles['fontawesome'] );
    return $styles;
}
JS styles

Description

Customize sales agents area by adding, modifying or removing scripts.

Definition
apply_filters( 'wcb2bsa_myaccount_scripts', array $scripts );
Example

To add a new script, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_scripts', 'fn_wcb2bsa_myaccount_scripts' );
function fn_wcb2bsa_myaccount_scripts( $scripts ) {
    $scripts['script-name'] = 'script-url';
    return $scripts;
}

To remove "Chart JS" script, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_scripts', 'fn_wcb2bsa_myaccount_scripts' );
function fn_wcb2bsa_myaccount_scripts( $scripts ) {
    unset( $scripts['chart'] );
    return $scripts;
}
Logo

Description

Customize sales agents area logo by replacing with a new one. This override logo inserted by WordPress customizer.

Definition
apply_filters( 'wcb2bsa_myaccount_logo_url', string $logo_url );
Example

To change logo, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_logo_url', 'fn_wcb2bsa_myaccount_logo_url' );
function fn_wcb2bsa_myaccount_logo_url( $logo_url ) {
    return 'new-logo-url';
}
Menu items

Description

Customize sales agents area menu by managing items.

Definition
apply_filters( 'wcb2bsa_myaccount_menu_items', array $items );
Example

To add a new menu link in "Main" section, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_menu_items', 'fn_wcb2bsa_myaccount_menu_items' );
function fn_wcb2bsa_myaccount_menu_items( $items ) {
    $items['main']['entries']['new-endpoint-slug'] = array(
        'label'     => __( 'Title', 'woocommerce-b2b-sales-agents' ),
        'icon'      => 'fas fa-icon'
    );
    return $items;
}

To remove an item from menu in "Profile" section, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_myaccount_menu_items', 'fn_wcb2bsa_myaccount_menu_items' );
function fn_wcb2bsa_myaccount_menu_items( $items ) {
    unset( $items['profile']['entries']['sales-agent-edit-account'] );
    return $items;
}
Page templates

Description

Allow to have different myaccount page templates for customers and sales agents, by changing template search folder from 'woocommerce' to 'woocommerce-b2b-sales-agents'.

Definition
apply_filters( 'wcb2bsa_template_override_sales_agent', array $override );
Example

If you want to create a different template for new order email received by customer, when order is created by sales agent, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_template_override_sales_agent', 'fn_wcb2bsa_template_override_sales_agent' );
function fn_wcb2bsa_template_override_sales_agent( $override ) {
    $override[] = 'emails/customer-on-hold-order.php';
    return $override;
}

In this way:

  • if order is created by customer, "customer-on-hold-order.php" file used to generate email will located in {YOUR_THEME}/woocommerce/emails folder
  • if order is created by sales agent, "customer-on-hold-order.php" file used to generate email will located in {YOUR_THEME}/woocommerce-b2b-sales-agents/emails folder

So you can feel free to customize WooCommerce templates according to user role.

Empty cart on account switch

Description

When a sales agent switch on customer account, cart is emptied by default. However, it is possible to change this behavior, avoiding the removal of products previously placed in the cart by the customer.

Definition
apply_filters( 'wcb2bsa_empty_cart_on_switch', boolean $empty );
Defaults
$empty = true
Example

If you don't want to empty cart when a sales agent switch on customer account, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_empty_cart_on_switch', '__return_false' );
Switch to customer redirect

Description

Allow to set a custom page URL where redirect sales agents after they switch as customer.

Definition
apply_filters( 'wcb2bsa_switch_to_customer_redirect', string $permalink );
Example

If you want to redirect sales agents to homepage instead of shop page, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_switch_to_customer_redirect', 'fn_wcb2bsa_switch_to_customer_redirect' );
function fn_wcb2bsa_switch_to_customer_redirect( $permalink ) {
    return get_home_url();
}
Switch to sales agent redirect

Description

Allow to set a custom page URL where redirect sales agents after they switch from customer to return on their own area.

Definition
apply_filters( 'wcb2bsa_switch_to_sales_agent_redirect', string $permalink );
Example

If you want to redirect sales agents to customers page instead of dashboard, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_switch_to_sales_agent_redirect', 'fn_wcb2bsa_switch_to_sales_agent_redirect' );
function fn_wcb2bsa_switch_to_sales_agent_redirect( $permalink ) {
    return wc_get_endpoint_url( 'sales-agent-customers', '', wc_get_page_permalink( 'myaccount' ) );
}
Translating tables utilities

Description

To translate advanced tables labels (ie: "Search", "Export", "View", etc.), you first need to create a new folder (ie: wcb2bsa) in your theme folder (we suggest to create it in a child theme). Now, copy 'woocommerce-b2b-sales-agents/https://woocommerce-b2b.com/sales-agents/wp-content/docs/woocommerce-b2b-sales-agents/assets/vendor/datatables/i18n/en_US.json' file into this new folder and rename the file with your desired language code (ie: it_IT.json). Finally, edit this file and translare strings on right side. To have an example and know more about, please take a look to: DataTables internationalisation.

Definition
apply_filters( 'wcb2bsa_dt_i18n_folder', string $url );
Example

If you have: 'wp-content/themes/child-theme/wcb2bsa/xx_XX.json', you can add this code to your functions.php file:

add_filter( 'wcb2bsa_dt_i18n_folder', 'fn_wcb2bsa_dt_i18n_folder' );
function fn_wcb2bsa_dt_i18n_folder( $url ) {
    // https://www.example.com/wp-content/themes/child-theme/wcb2bsa/xx_XX.json
    return get_stylesheet_directory_uri() . '/wcb2bsa/' . get_locale() . 'json';
}

If you prefer, you can also insert a CDN or external URL to JSON translation file.

Get sales agent assigned customers

Description

Customize sales agents assigned customers list.

Definition
apply_filters( 'wcb2bsa_get_customers_by_sales_agent_args', array $args, int $sales_agent_id );
Example

To exclude a specific user by ID, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_get_customers_by_sales_agent_args', 'fn_wcb2bsa_get_customers_by_sales_agent_args', 10, 2 );
function fn_wcb2bsa_get_customers_by_sales_agent_args( $args, $sales_agent_id ) {
    $args['exclude'] = array( 10 );
    return $args;
}

To know more about $args allowed fields, please refer to WP_User_Query official documentation.

Get sales agent assigned orders

Description

Customize sales agents assigned orders list.

Definition
apply_filters( 'wcb2bsa_get_orders_by_sales_agent_args', array $args, int $sales_agent_id );
Example

To get orders with Direct bank transfer payment method, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_get_orders_by_sales_agent_args', 'fn_wcb2bsa_get_orders_by_sales_agent_args', 10, 2 );
function fn_wcb2bsa_get_orders_by_sales_agent_args( $args, $sales_agent_id ) {
    $args['payment_method'] = 'bacs';
    return $args;
}

To know more about $args allowed fields, please refer to WC_Order_Query official documentation.

Get sales agent assigned notifications

Description

Customize sales agents assigned notifications list.

Definition
apply_filters( 'wcb2bsa_get_notifications_by_sales_agent_args', array $args, int $sales_agent_id );
Example

To exclude a specific notification by ID, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_get_notifications_by_sales_agent_args', 'fn_wcb2bsa_get_notifications_by_sales_agent_args', 10, 2 );
function fn_wcb2bsa_get_notifications_by_sales_agent_args( $args, $sales_agent_id ) {
    $args['exclude'] = array( 10 );
    return $args;
}

To know more about $args allowed fields, please refer to WP_User_Query official documentation.

Pending commission calculation

Description

Decide which orders include in pending commission calculation by order status.

Definition
apply_filters( 'wcb2bsa_include_orders_in_pending_commissions_by_status', array $statuses, int $sales_agent_id );
Example

To remove "on-hold" orders from pending commission totals, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_include_orders_in_pending_commissions_by_status', 'fn_wcb2bsa_include_orders_in_pending_commissions_by_status', 10, 2 );
function fn_wcb2bsa_include_orders_in_pending_commissions_by_status( $statuses, $sales_agent_id ) {
    if ( ( $key = array_search( 'on-hold', $statuses ) ) !== false ) {
        unset( $statuses[$key] );
    }
    return $statuses;
}

Default statuses included in pending commission totals are:

  • completed
  • on-hold
  • pending
  • processing
Total commission calculation

Description

Decide which orders exclude in total orders amount calculation by order status.

Definition
apply_filters( 'wcb2bsa_exclude_orders_in_totals_by_status', array $statuses, int $sales_agent_id );
Example

To add "on-hold" orders in sales agent total orders amount, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_exclude_orders_in_totals_by_status', 'fn_wcb2bsa_exclude_orders_in_totals_by_status', 10, 2 );
function fn_wcb2bsa_exclude_orders_in_totals_by_status( $statuses, $sales_agent_id ) {
    $statuses[] = 'on-hold';
    return $statuses;
}

Default statuses excluded in sales agent total orders amount are:

  • cancelled
  • failed
  • refunded
Items eligible for commission

Description

You can choose to don't apply a commission to order item type in WooCommerce B2B Sales Agents settings page, but if you install a third part plugin that add some custom item types in orders, you you may want apply sales agents commission on these new items.

Definition
apply_filters( 'wcb2bsa_order_item_types_eligible_for_commission', array $items );
Example

To add a new item type in setting eligible items for commission, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_order_item_types_eligible_for_commission', 'fn_wcb2bsa_order_item_types_eligible_for_commission' );
function fn_wcb2bsa_order_item_types_eligible_for_commission( $items ) {
    $items['item-slug'] = __( 'Item name', woocommerce-b2b-sales-agents );
    return $items;
}

Default items are those provided by WooCommerce:

  • Products
  • Fees
  • Shipping costs
Cart price input field arguments

Description

Customize price input field added in cart page by changing arguments.

Definition
apply_filters( 'wcb2bsa_cart_input', array $args );
Defaults
$args = array(
    'class' => 'input-text text',
    'min'   => '0',
    'step'  => '0.01'
);
Example

To add a custom class to improve your theme compatibility, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_cart_input', 'fn_wcb2bsa_cart_input' );
function fn_wcb2bsa_cart_input( $args ) {
    $args['class'] .= ' my-custom-class';
    return $args;
}
Affiliate base URL

Description

Lets you edit the link to the affiliation landing page.

Definition
apply_filters( 'wcb2bsa_affiliate_baseurl', string $url );
Example

To change URL, you can add this code to your functions.php file:

add_filter( 'wcb2bsa_affiliate_baseurl', 'fn_wcb2bsa_affiliate_baseurl' );
function fn_wcb2bsa_affiliate_baseurl( $url ) {
    // https://www.example.com/my-registration-page, Page ID 100 
    return get_the_permalink( 100 );
}
Sales Agents area new customer form fields

Description

Used to manage new customer form fields when extended form is enabled.

Definition
apply_filters( 'wcb2bsa_new_customer_form_fields', array $fields );
Example

To make phone number required, you can add this code to your functions.php file:

add_action( 'wcb2bsa_new_customer_form_fields', 'fn_wcb2bsa_new_customer_form_fields' );
function fn_wcb2bsa_new_customer_form_fields( $fields ) {
    $fields['phone']['required'] = true;
    return $fields;
}
Sales Agents area new customer form fields arguments

Description

Used to manage new customer form fields arguments to customize fields.

Definition
apply_filters( 'wcb2bsa_new_customer_form_fields_args', array $args );
Example

To apply a custom class to new customer form fields container, you can add this code to your functions.php file:

add_action( 'wcb2bsa_new_customer_form_fields_args', 'fn_wcb2bsa_new_customer_form_fields_args' );
function fn_wcb2bsa_new_customer_form_fields_args( $args ) {
    $args['class'] = array( 'my_custom_class' );
    return $args;
}

To know more about $args allowed fields, please refer to Hook description.

Sales Agents area new customer form

Description

Triggered in sales agents dedicated area in new customer form modal.

Definition
do_action( 'wcb2bsa_new_customer_form' );
Example

To add a new callback, you can add this code to your functions.php file:

add_action( 'wcb2bsa_new_customer_form', 'fn_wcb2bsa_new_customer_form' );
function fn_wcb2bsa_new_customer_form() {
    // Make action magic happen here...
}
WooCommerce B2B Sales Agents before init

Description

Triggered when WordPress initialises.

Definition
do_action( 'wcb2bsa_before_init' );
Example

To add a new callback, you can add this code to your functions.php file:

add_action( 'wcb2bsa_before_init', 'fn_wcb2bsa_before_init' );
function fn_wcb2bsa_before_init() {
    // Make action magic happen here...
}
WooCommerce B2B Sales Agents init

Description

Triggered after plugin has initialized.

Definition
do_action( 'wcb2bsa_init' );
Example

To add a new callback, you can add this code to your functions.php file:

add_action( 'wcb2bsa_init', 'fn_wcb2bsa_init' );
function fn_wcb2bsa_init() {
    // Make action magic happen here...
}
WooCommerce B2B Sales Agents loaded

Description

Triggered when plugin has loaded.

Definition
do_action( 'wcb2bsa_loaded' );
Example

To add a new callback, you can add this code to your functions.php file:

add_action( 'wcb2bsa_wcb2bsa_loaded', 'fn_wcb2bsa_loaded' );
function fn_wcb2bsa_loaded() {
    // Make action magic happen here...
}
Sales Agents area print styles

Description

Triggered in sales agents dedicated area to print styles.

Definition
do_action( 'wcb2bsa_print_styles' );
Example

To add a new callback, you can add this code to your functions.php file:

add_action( 'wcb2bsa_print_styles', 'fn_wcb2bsa_print_styles' );
function fn_wcb2bsa_print_styles() {
    // Make action magic happen here...
}
Sales Agents area print script

Description

Triggered in sales agents dedicated area to print scripts.

Definition
do_action( 'wcb2bsa_print_scripts' );
Example

To add a new callback, you can add this code to your functions.php file:

add_action( 'wcb2bsa_print_scripts', 'fn_wcb2bsa_print_scripts' );
function fn_wcb2bsa_print_scripts() {
    // Make action magic happen here...
}
REST API support
Manage WooCommerce B2B Sales Agents data with extended REST API.

Product API

Description

This API lets you retrieve and view all products or a specific product by ID.

WooCommerce B2B Sales Agents available meta fields:

  • wcb2bsa_commissions: contains dedicated commissions by sales agent.
    Value is an associative array with SALES AGENT ID as key and commission percentage as value (it's a floating number).
    In API GET response, has also a dedicated field alias named "wcb2bsa_commissions"

Note: WooCommerce B2B Sales Agents extends default WooCommerce products REST API with own custom meta fields. For more informations, please visit: WooCommerce Official documentation


HTTP request (all products)
get
/wp-json/wc/v3/products

HTTP request (single product)
get
/wp-json/wc/v3/products/{ID}

Example response
{
    "id": 60,
    "name": "T-Shirt with Logo",
    "slug": "t-shirt-with-logo",
    "permalink": "https://demo.woocommerce-b2b.com/product/t-shirt-with-logo/",
    "date_created": "2020-06-13 00:00:00",
    "date_created_gmt": "2020-06-13 00:00:00",
    "date_modified": "2020-06-13 00:00:00",
    "date_modified_gmt": "2020-06-13 00:00:00",
    "type": "simple",
    "status": "publish",
    "featured": false,
    "catalog_visibility": "visible",
    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
    "short_description": "<p>This is a simple product.</p>\n",
    "sku": "Woo-tshirt-logo",
    "price": "98",
    "regular_price": "100",
    "sale_price": "98",
    "date_on_sale_from": null,
    "date_on_sale_from_gmt": null,
    "date_on_sale_to": null,
    "date_on_sale_to_gmt": null,
    "price_html": "<del><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>100.00</span></del> <ins><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>98.00</span></ins>",
    "on_sale": true,
    "purchasable": true,
    "total_sales": 0,
    "virtual": false,
    "downloadable": false,
    "downloads": [],
    "download_limit": 0,
    "download_expiry": 0,
    "external_url": "",
    "button_text": "",
    "tax_status": "taxable",
    "tax_class": "",
    "manage_stock": false,
    "stock_quantity": null,
    "stock_status": "instock",
    "backorders": "no",
    "backorders_allowed": false,
    "backordered": false,
    "sold_individually": false,
    "weight": "",
    "dimensions": {
        "length": "10",
        "width": "12",
        "height": "0.5"
    },
    "shipping_required": true,
    "shipping_taxable": true,
    "shipping_class": "",
    "shipping_class_id": 0,
    "reviews_allowed": true,
    "average_rating": "0.00",
    "rating_count": 0,
    "related_ids": [
        50,
        40,
        43,
        51
    ],
    "upsell_ids": [],
    "cross_sell_ids": [],
    "parent_id": 0,
    "purchase_note": "",
    "categories": [
        {
            "id": 20,
            "name": "Tshirts",
            "slug": "tshirts-clothing"
        }
    ],
    "tags": [],
    "images": [
        {
            "id": 83,
            "date_created": "2020-06-13 00:00:00",
            "date_created_gmt": "2020-06-13 00:00:00",
            "date_modified": "2020-06-13 00:00:00",
            "date_modified_gmt": "2020-06-13 00:00:00",
            "src": "https://demo.woocommerce-b2b.com/wp-content/uploads/2020/06/t-shirt-with-logo-1.jpg",
            "name": "t-shirt-with-logo-1.jpg",
            "alt": ""
        }
    ],
    "attributes": [
        {
            "id": 1,
            "name": "Color",
            "position": 0,
            "visible": true,
            "variation": false,
            "options": [
            "Gray"
            ]
        }
    ],
    "default_attributes": [],
    "variations": [],
    "grouped_products": [],
    "menu_order": 0,
    "meta_data": [
        {
            "id": 967,
            "key": "_wpcom_is_markdown",
            "value": "1"
        },
        {
            "id": 3156,
            "key": "wcb2bsa_commissions",
            "value": {
            "9": "10"
        }
    ],
    "wcb2bsa_commissions": [
        {
            "9": 10
        }
    ],
    "_links": {
        "self": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/products/60"
            }
        ],
        "collection": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/products"
            }
        ]
    }
}
Customer API

Description

This API lets you retrieve and view all customers or a specific customer by ID.

WooCommerce B2B Sales Agents available meta fields:

  • wcb2bsa_commission: contains global commission percentage (only for sales agents).
    Value is a floating number
    In API GET response, has also a dedicated field alias named "wcb2bsa_commission"
  • wcb2bsa_order_notification: contains order notification status (only for sales agents).
    Value can be 0 (=disabled) or 1 (=enabled)
    In API GET response, has also a dedicated field alias named "wcb2bsa_order_notification"
  • wcb2bsa_affiliate_link: contains sales agent unique affiliation link (only for sales agents).
    Value is a URL
    In API GET response, has also a dedicated field alias named "wcb2bsa_affiliate_link"
  • wcb2bsa_customers_default_group: contains default group assigned to customers registered by sales agent (only for sales agents / Only if WooCommerce B2B is installed).
    Value is an integer number or a string ("choose")
    In API GET response, has also a dedicated field alias named "wcb2bsa_customers_default_group"
  • wcb2bsa_sales_agent: contains assigned sales agent ID (only for customers).
    Value is an integer number
    In API GET response, has also a dedicated field alias named "wcb2bsa_sales_agent"

Note: WooCommerce B2B Sales Agents extends default WooCommerce products REST API with own custom meta fields. For more informations, please visit: WooCommerce Official documentation


HTTP request (all customers)
get
/wp-json/wc/v3/customers

HTTP request (single customer)
get
/wp-json/wc/v3/customers/{ID}

Example response (customer)
{
    "id": 2,
    "date_created": "2020-06-13T00:00:0",
    "date_created_gmt": "2020-06-13T00:0:0",
    "date_modified": "2020-06-13T00:00:00",
    "date_modified_gmt": "2020-06-13T00:00:00",
    "email": "customer@woocommerce-b2b.com",
    "first_name": "John",
    "last_name": "Doe",
    "role": "customer",
    "username": "customer",
    "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "Google LLC",
        "address_1": "Central Park, 1",
        "address_2": "",
        "city": "New York",
        "postcode": "10001",
        "country": "US",
        "state": "NY",
        "email": "customer@woocommerce-b2b.com",
        "phone": "212-223-6457"
    },
    "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "Google LLC",
        "address_1": "Central Park, 1",
        "address_2": "",
        "city": "New York",
        "postcode": "10001",
        "country": "US",
        "state": "NY"
    },
    "is_paying_customer": true,
    "avatar_url": "https://secure.gravatar.com/avatar/25c626881bff6847aa6efc0820f01ec5?s=96&d=mm&r=g",
    "meta_data": [
        {
            "id": 62,
            "key": "wc_last_active",
            "value": "1592092800"
        },
        {
        "id": 353,
            "key": "shipping_method",
            "value": [
                "flat_rate:2"
            ]
        },
        {
            "id": 880,
            "key": "wcb2bsa_sales_agent",
            "value": "9"
        }
    ],
    "wcb2bsa_sales_agent": 9,
    "_links": {
        "self": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/customers/2"
            }
        ],
        "collection": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/customers"
            }
        ]
    }
}

Example response (sales agent)
{
    "id": 3,
    "date_created": "2020-06-13T00:00:0",
    "date_created_gmt": "2020-06-13T00:0:0",
    "date_modified": "2020-06-13T00:00:00",
    "date_modified_gmt": "2020-06-13T00:00:00",
    "email": "sales@woocommerce-b2b.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "role": "customer",
    "username": "customer",
    "billing": {
        "first_name": "Jane",
        "last_name": "Doe",
        "company": "Google LLC",
        "address_1": "Central Park, 1",
        "address_2": "",
        "city": "New York",
        "postcode": "10001",
        "country": "US",
        "state": "NY",
        "email": "sales@woocommerce-b2b.com",
        "phone": "212-223-6457",
        "vat_number": "0987654321"
    },
    "shipping": {
        "first_name": "Jane",
        "last_name": "Doe",
        "company": "Google LLC",
        "address_1": "Central Park, 1",
        "address_2": "",
        "city": "New York",
        "postcode": "10001",
        "country": "US",
        "state": "NY"
    },
    "is_paying_customer": true,
    "avatar_url": "https://secure.gravatar.com/avatar/25c626881bff6847aa6efc0820f01ec5?s=96&d=mm&r=g",
    "meta_data": [
        {
            "id": 62,
            "key": "wc_last_active",
            "value": "1592092800"
        },
        {
        "id": 353,
            "key": "shipping_method",
            "value": [
                "flat_rate:2"
            ]
        },
        {
            "id": 880,
            "key": "wcb2bsa_commission",
            "value": "10"
        },
        {
            "id": 890,
            "key": "wcb2bsa_order_notification",
            "value": "0"
        },
        {
            "id": 900,
            "key": "wcb2bsa_customers_default_group",
            "value": "74"
        },
        {
            "id": 910,
            "key": "wcb2bsa_affiliate_link",
            "value": "https://demo.woocommerce-b2b.com/sales-agents/my-account/?wcb2bsa_affiliate=c2FsZXNAd29vY29tbWVyY2UtYjJiLmNvbXwxNA="
        }
    ],
    "wcb2bsa_commission": 10,
    "wcb2bsa_order_notification": 0,
    "wcb2bsa_affiliate_link": "https://demo.woocommerce-b2b.com/sales-agents/my-account/?wcb2bsa_affiliate=c2FsZXNAd29vY29tbWVyY2UtYjJiLmNvbXwxNA=",
    "wcb2bsa_customers_default_group": 74,
    "_links": {
        "self": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/customers/3"
            }
        ],
        "collection": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/customers"
            }
        ]
    }
}
Order API

Description

This API lets you retrieve and view all orders or a specific order by ID.

WooCommerce B2B Sales Agents available meta fields:

  • wcb2bsa_sales_agent: contains assigned sales agent ID when order placed.
    Value is an integer number
    In API GET response, has also a dedicated field alias named "wcb2bsa_sales_agent"
  • wcb2bsa_order_item_types_eligible_for_commission: contains item types on which commissions can be applied and calculated when order placed.
    Value is an associative array with ITEM TYPE as key and enabled flag as value (it's a tinyint number, 0 (=disabled) or 1 (=enabled)).
    In API GET response, has also a dedicated field alias named "wcb2bsa_order_item_types_eligible_for_commission"
  • wcb2bsa_created_by: contains who created the order.
    Value is a string, can be "customer", "sales_agent", "admin"
    In API GET response, has also a dedicated field alias named "wcb2bsa_created_by"

Each "line_items" contains specific meta fields:

  • wcb2bsa_item_commission: contains single item percentage commission when order placed.
    Value is an floating number
  • wcb2bsa_custom_price: contains if item price has been altered and customized by sales agent in cart when order placed.
    Value is a boolean

Note: WooCommerce B2B Sales Agents extends default WooCommerce products REST API with own custom meta fields. For more informations, please visit: WooCommerce Official documentation


HTTP request (all orders)
get
/wp-json/wc/v3/orders

HTTP request (single order)
get
/wp-json/wc/v3/orders/{ID}

Example response
{
    "id": 101,
    "parent_id": 0,
    "number": "101",
    "order_key": "wc_order_AZ59JpOFpEQcv",
    "created_via": "checkout",
    "version": "4.3.0",
    "status": "completed",
    "currency": "USD",
    "date_created": "2020-06-13T02:00:0",
    "date_created_gmt": "2020-06-13T00:00:0",
    "date_modified": "2020-06-13T02:00:0",
    "date_modified_gmt": "2020-06-13T00:00:0",
    "discount_total": "0.00",
    "discount_tax": "0.00",
    "shipping_total": "20.00",
    "shipping_tax": "4.40",
    "cart_tax": "51.12",
    "total": "307.90",
    "total_tax": "55.52",
    "prices_include_tax": true,
    "customer_id": 2,
    "customer_ip_address": "***",
    "customer_user_agent": "***",
    "customer_note": "",
    "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "Google LLC",
        "address_1": "Central Park, 1",
        "address_2": "",
        "city": "New York",
        "state": "NY",
        "postcode": "10001",
        "country": "US",
        "email": "customer@woocommerce-b2b.com",
        "phone": "2122236457"
    },
    "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "Google LLC",
        "address_1": "Central Park, 1",
        "address_2": "",
        "city": "New York",
        "state": "NY",
        "postcode": "10001",
        "country": "US"
    },
    "payment_method": "bacs",
    "payment_method_title": "Direct bank transfer",
    "transaction_id": "",
    "date_paid": "2020-06-13T02:00:0",
    "date_paid_gmt": "2020-06-13T00:00:0",
    "date_completed": "2020-06-13T02:00:0",
    "date_completed_gmt": "2020-06-13T00:00:0",
    "cart_hash": "4c4d2a2498f758a949a05f83a439b8e5",
    "meta_data": [
        {
            "id": 1068,
            "key": "wcb2bsa_sales_agent",
            "value": "3"
        },
        {
            "id": 1069,
            "key": "wcb2bsa_order_item_types_eligible_for_commission",
            "value": {
                "line_item": "1",
                "fee": "1",
                "shipping": "1"
            }
        },
        {
            "id": 1487,
            "key": "wcb2bsa_created_by",
            "value": "sales_agent"
        }
    ],
    "line_items": [
        {
            "id": 9,
            "name": "Hoodie - Blue, Yes",
            "product_id": 12,
            "variation_id": 35,
            "quantity": 7,
            "tax_class": "",
            "subtotal": "232.38",
            "subtotal_tax": "51.12",
            "total": "232.38",
            "total_tax": "51.12",
            "taxes": [
                {
                    "id": 1,
                    "total": "51.12",
                    "subtotal": "51.12"
                }
            ],
            "meta_data": [
                {
                    "id": 82,
                    "key": "pa_color",
                    "value": "blue",
                    "display_key": "Color",
                    "display_value": "Blue"
                },
                {
                    "id": 83,
                    "key": "logo",
                    "value": "Yes",
                    "display_key": "Logo",
                    "display_value": "Yes"
                },
                {
                    "id": 84,
                    "key": "wcb2bsa_item_commission",
                    "value": "10",
                    "display_key": "wcb2bsa_item_commission",
                    "display_value": "10"
                },
                {
                    "id": 1933,
                    "key": "wcb2bsa_custom_price",
                    "value": "true",
                    "display_key": "wcb2bsa_custom_price",
                    "display_value": "true"
                }
            ],
            "sku": "woo-hoodie-blue-logo",
            "price": 33.19672128571428,
            "parent_name": "Hoodie"
        }
    ],
    "tax_lines": [
        {
            "id": 11,
            "rate_code": "TAX-1",
            "rate_id": 1,
            "label": "Tax",
            "compound": false,
            "tax_total": "51.12",
            "shipping_tax_total": "4.40",
            "rate_percent": 22,
            "meta_data": [
                {
                    "id": 98,
                    "key": "wcb2bsa_item_commission",
                    "value": "10",
                    "display_key": "wcb2bsa_item_commission",
                    "display_value": "10"
                }
            ]
        }
    ],
    "shipping_lines": [
        {
            "id": 10,
            "method_title": "Flat rate",
            "method_id": "flat_rate",
            "instance_id": "2",
            "total": "20.00",
            "total_tax": "4.40",
            "taxes": [
                {
                    "id": 1,
                    "total": "4.4",
                    "subtotal": ""
                }
            ],
            "meta_data": [
                {
                    "id": 90,
                    "key": "Products",
                    "value": "Hoodie - Blue, Yes × 7",
                    "display_key": "Products",
                    "display_value": "Hoodie - Blue, Yes × 7"
                },
                {
                    "id": 91,
                    "key": "wcb2bsa_item_commission",
                    "value": "10",
                    "display_key": "wcb2bsa_item_commission",
                    "display_value": "10"
                }
            ]
        }
    ],
    "fee_lines": [],
    "coupon_lines": [],
    "refunds": [],
    "currency_symbol": "$",
    "wcb2bsa_sales_agent": 3,
    "wcb2bsa_order_item_types_eligible_for_commission": {
        "line_item": "1",
        "fee": "1",
        "shipping": "1"
    },
    "wcb2bsa_created_by": "sales_agent",
    "_links": {
        "self": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/orders/101"
            }
        ],
        "collection": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/orders"
            }
        ],
        "customer": [
            {
                "href": "https://demo.woocommerce-b2b.com/sales-agents/wp-json/wc/v3/customers/2"
            }
        ]
    }
}

For more informations about REST API, please take a look to WooCommerce Official documentation.

Templates customization
WooCommerce B2B Sales Agents templates can be override to customize as you prefer.

Templates override

WooCommerce B2B Sales Agents make use of same WooCommerce override system, so it's possible to create own templates and customize them.

Here a list of WooCommerce B2B Sales Agents templates that can be customized:

  • templates/email/email-sales-agent.php: sales agent data to include in customer emails.
  • templates/global/breadcrumb.php: sales agents area breadcrumb
  • templates/global/footer.php: sales agents area footer
  • templates/global/header.php: sales agents area header
  • templates/global/sidebar.php: sales agents area sidebar
  • templates/global/switchbar.php: customer switchbar to return to sales agent profile
  • templates/myaccount/commissions.php: sales agents area commissions list
  • templates/myaccount/customers.php: sales agents area customers list
  • templates/myaccount/dashboard.php: sales agents area dashboard
  • templates/myaccount/edit-account.php: sales agents area edit account profile
  • templates/myaccount/my-account.php: sales agents area main page
  • templates/myaccount/notifications.php: sales agents area notifications list
  • templates/myaccount/orders.php: sales agents area orders list
  • templates/myaccount/statistics.php: sales agents area statistics list
  • templates/myaccount/view-customer.php: sales agents area single customer page
  • templates/myaccount/view-order.php: sales agents area single order page
  • templates/notices/error.php: sales agents area error notification
  • templates/notices/notice.php: sales agents area notice notification
  • templates/notices/success.php: sales agents area success notification
How to override a template
  1. Copy the default template from:
    wp-content/plugins/woocommerce-b2b-sales-agents/templates/{TEMPLATE_PATH}
    and paste it in your theme folder at:
    wp-content/themes/{YOUR_ACTIVE_THEME}/woocommerce-b2b-sales-agents/
    preserving the same folder tree.
  2. Open the template you pasted into the theme folder with a text editor of choice and perform any changes that you want in your new template file.

To know more about this kind of system, take a look to Template structure & Overriding templates via a theme.

How to update templates overrides

Sometimes we update default templates when a new version of WooCommerce B2B is released. If you are using older templates, you may need to update them.

  1. Go to: WooCommerce > Settings > Sales Agents > Status. Here there is a list of templates overridden by your theme/child theme and a warning message that they need to be updated.

    • Status tab
  2. Save a backup of the outdated template.
  3. Copy the default template from:
    wp-content/plugins/woocommerce-b2b-sales-agents/templates/{TEMPLATE_PATH}
    and paste it in your theme folder at:
    wp-content/themes/{YOUR_ACTIVE_THEME}/woocommerce-b2b-sales-agents/
    preserving the same folder tree.
  4. Open the template you pasted into the theme folder with a text editor of choice and replicate any changes that you had to the previous template in your new, updated template file.
Compatibility
Take a look to most common compatibility adjusts about WooCommerce B2B Sales Agents with other plugins or themes.

WooCommerce B2B Sales Agents make use of standard WooCommerce hooks and best practice to warranty a great compatibility with themes or third part plugins.

However, in some cases, there may be minor incompatibilities that need minor adjustments.

As WordPress best practice, we suggesto to make use of a WordPress Child Theme to avoid losing customizations in case of theme update. To know more about WordPress Child Theme, take alook to Child Themes WordPress Codex.

Here are the known ones.


-- No known compatibility issues --
Frequently Asked Questions
Take a look to users most common questions and learn more about WooCommerce B2B Sales Agents.

Take advantage of other users experience, by reading our FAQs

Changelog
What's new in latest WooCommerce B2B Sales Agents version?

Here all the versions of WooCommerce B2B Sales Agents: Changelog

Support
Need help with WooCommerce B2B Sales Agents and you cannot find the solution in documentation?

Thanks for purchasing WooCommerce B2B Sales Agents plugin for WordPress/WooCommerce, proudly developed by @code4life, visit the author website.

If you have any kind of question or doubt, please visit new WooCommerce B2B Support Center, we'll do our best to assist you.

WooCommerce B2B support team