Create URL Query Parameter to filter categories on the Wholesale Order Form

Create URL Query Parameter to filter categories on the Wholesale Order Form

Are you looking for a way to easily customize multiple Wholesale Order Forms to display different categories?
If you want to display different Wholesale Order Forms, the best way to do so is by using the Wholesale Order Form shortcodes.
However, if you have a lot of product categories and you want an easier way to redirect users with filtered category, an alternative is by using a URL Query Parameter for the Wholesale Order Form.
To do this, you need to add the custom code below on your functions.php. Then you can now create a URL with a query parameter based on your product category.

add_filter( 'wwof_product_args' , function( $args , $filter ) {
$cat_filter = isset( $_POST[ 'cat_filter'] ) ? $_POST[ 'cat_filter'] : '';
if( empty( $cat_filter ) ) {
parse_str( parse_url( $_SERVER['HTTP_REFERER'] , PHP_URL_QUERY ) , $output );
if( isset( $output['cat_slug'] ) ) {
$args[ 'tax_query' ][] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( $output['cat_slug'] ),
);
}
}
return $args;
} , 90 , 2 );
To use this, let』s say you have a product category with a slug 「clothing」. Get the URL of your Wholesale Ordering page and add ?cat_slug=clothing at the end. The URL should look something like this:
http://yoursite.com/wholesale-ordering/?cat_slug=clothing
When this link is clicked or visited, it will redirect you to the Wholesale Order Form page filtered under the clothing category.

Last Updated: 2 years ago in WooCommerce Wholesale Order Form

How To Translate Wholesale Price text

How To Translate Wholesale Price text

Due to the feature of our plugin to modify the 「Wholesale Price:」 texts on WooCommerce > Settings > Wholesale Prices > Price, it won』t be possible to translate it directly.
You』ll need to use a custom snippet to set the string in a translation wrapper before you can translate it using a translation plugin. Please copy the snippet below to your theme/child theme』s functions.php file:
add_filter( 'wwp_filter_wholesale_price_title_text' , 'my_filter_wholesale_price', 99 , 1 );
function my_filter_wholesale_price ( $titleText ) {

$settingTitleText = __('Wholesale Price:', 'woocommerce-wholesale-prices-premium');
return $settingTitleText;

}

Please take note that if you use this snippet, the feature to change the Wholesale Price Text will be disabled.

How to Hide Retail Categories to Wholesale Users

How to Hide Retail Categories to Wholesale Users

We have an option to Only Show Wholesale Products to Wholesale customers. However, this feature won』t hide the retail categories displayed in your shop.
Fortunately, there is acustom snippets that you can use to hide unwanted retail categories from your wholesale users. Please kindly add the following snippet to your child theme』s function.php.
add_filter( 'get_terms' , function( $terms, $tax, $qvars, $term_query ) {
if( is_shop() || is_product_category() ) {

global $wc_wholesale_prices_premium;

$user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole();
$wholesale_role = isset( $user_wholesale_role[ 0 ] ) ? $user_wholesale_role[ 0 ] : '';

foreach( $terms as $key => $term ) {

$product_ids = array();
$products = WWPP_WPDB_Helper::getProductsByCategory( $term->term_id ); // WP_Post

foreach ( $products as $product )
$product_ids[] = $product->ID;

if( !empty( $wholesale_role ) )
$restricted_cat_ids = $wc_wholesale_prices_premium->wwpp_query->_get_restricted_product_cat_ids_for_wholesale_user( $wholesale_role );
else
$restricted_cat_ids = get_option( WWPP_OPTION_PRODUCT_CAT_WHOLESALE_ROLE_FILTER , array() );

$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => -1,
'fields' => 'ids',
'post__in' => $product_ids,
'meta_query' => array(
array(
'key' => WWPP_PRODUCT_WHOLESALE_VISIBILITY_FILTER,
'value' => array( $wholesale_role , 'all' ),
'compare' => 'IN'
)
),
'tax_query' => empty( $restricted_cat_ids ) ? array() : array(
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => array_map( 'intval' , $restricted_cat_ids ),
'operator' => 'NOT IN'
)
)
);

if( !empty( $user_wholesale_role ) &&
get_option( 'wwpp_settings_only_show_wholesale_products_to_wholesale_users' ) == 'yes' &&
!WWPP_Helper_Functions::_wholesale_user_have_override_per_user_discount( $user_wholesale_role ) &&
!WWPP_Helper_Functions::_wholesale_user_have_general_role_discount( $wholesale_role ) ) {

$args[ 'meta_query' ][] = array(
'relation' => 'OR',
array(
'key' => $wholesale_role . '_have_wholesale_price',
'value' => 'yes',
'compare' => '='
),
array(
'key' => $wholesale_role . '_wholesale_price',
'value' => 0,
'compare' => '>',
'type' => 'NUMERIC'
)
);

}

$wholesale_query = new WP_Query( $args );

if( empty( $wholesale_query->post_count ) ) {
unset( $terms[ $key ] );
array_values( $terms );
}

}

}

return $terms;
}, 20 , 4);

How To Restrict Wholesale Customers To Using Particular Shipping Methods

How To Restrict Wholesale Customers To Using Particular Shipping Methods

Need to restrict your wholesale customers to use specific shipping methods?
Restricting your wholesale roles to use specific Shipping Methods can be handy when you want to set up a different shipping rate for your wholesale customers compared to your regular customers.
Mapping Wholesale Roles To Shipping Zones & Methods
Restricting your wholesale roles to using only certain shipping methods in WooCommerce Wholesale Prices Premium is very simple.
Navigate to the Shipping settings (WooCommerce->Settings, Wholesale Prices tab, click on Shipping in the submenu) and you will see the interface below:
Wholesale Restrict ShippingWholesale Shipping Mapping Settings(Click To Zoom)
When a wholesale user is detected at the cart or checkout, the plugin refers to the mapping you set in this interface to determine which shipping options they should see.
Any Shipping Methods that you map in this interface will be the ONLY methods your mapped wholesale role will see for that Shipping Zone.
How To Add A Wholesale Role -> Shipping Method Mapping
Before adding your mappings, please create your Shipping Zones (under WooCommerce->Settings, Shipping tab), load your Shipping Methods for that zone.
Here』s an example of a complete mapping setup for my zone of Australia:
Wholesale Restrict ShippingShipping Zone Setup Example(Click To Zoom)
Once you have finished configuring your shipping settings, come back to the Wholesale Prices tab, Shipping settings screen and:

Select the wholesale role you wish to restrict
Choose the shipping zone you want this to apply to
Finally, choose the shipping method in that shipping zone that you wish to restrict the selected wholesale role to

You can repeat this process to map multiple shipping methods per zone & multiple zones per role.
Wholesale Restrict ShippingWholesale Shipping Mapping Example(Click To Zoom)
Wholesale Specific Shipping Methods
To make your mapped Shipping Methods specifically for wholesale users you will also need to check the 「Wholesale Only Shipping Methods」 setting which hides the mapped shipping methods from non-wholesale customers.
Wholesale Restrict Shipping
This means that regular customers will no longer be able to see the shipping methods you have mapped, making them exclusively for wholesale customer use.
This feature is especially handy when you want to provide shipping options that are only for wholesale customers, such as Local Pickup or more complex methods that show the true cost of shipping rather than the regular options you offer normal customers.
Questions?
Please attempt to set up your shipping mapping prior to contacting support using the instructions above.
If you find you are having trouble getting it to work or have further questions about the wholesale shipping mapping features that aren』t answered here, please contact support.
Common Issue

One of the common mistakes, when people set up the WooCommerce Shipping Zone, is that people are creating a separate shipping zone for wholesale customers within the same region. If you have that setting, the shipping zone in the higher-order will override the other one and this causes the shipping method mapping to not be applied properly. Please check our KB here to help you address this issue.

How to Hide the Regular Prices and Sale Prices

How to Hide the Regular Prices and Sale Prices

By default, the product』s regular and sale prices are crossed out when a wholesale customer signs in. However, some shop owners don』t want to display the regular price to their wholesale customers.
By going to WooCommerce > Settings > Wholesale Prices > Price, they can enable the Hide Original Price feature and it should hide both the retail and sale price from your wholesale users.

However, if you only want to hide the sale price, we don』t have a built-in feature to hide sale price alone. For this, you』ll need to use a custom CSS to hide them while the retail prices are still visible and crossed out.
.original-computed-price ins:first-of-type{
display:none;
}

Just apply this small CSS code to your theme/child theme』s style.css and it should do the trick!

How Do I Stop Wholesale Users From Seeing Retail Only Products?

How Do I Stop Wholesale Users From Seeing Retail Only Products?

Once you have created your store, it』s likely that you will have a mix of retail and wholesale products.
With WooCommerce Wholesale Prices Premium you can control the visibility of products to wholesale customers.
This includes the ability to hide non-wholesale products, essentially meaning that if a product doesn』t have a wholesale price defined it will be hidden from wholesale users once they』re logged in.
To find this setting:

Login to WordPress
Click on WooCommerce->Settings
Click on the Wholesale Prices > General
The first setting under the Wholesale Product options is the 「Only Show Wholesale Products To Wholesale Users」 option


If this setting is activated your wholesale users will only see products where a wholesale price has been set.

WooCommerce Wholesale Prices Premium REST API Documentation

WooCommerce Wholesale Prices Premium REST API Documentation

As of version 1.18, WooCommerce Wholesale Prices Premium (WWPP) introduces integration with WooCommerce API. This allows Wholesale Products to be created, read, updated, and deleted using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients. The current WP REST API integration version is v3.
Getting Started
In this article, we won』t cover how to access or use the endpoints. It』s up to you to decide which method you will use to access the data. But in our examples, we use JSON to show how the data can be sent and received. To learn more about WooCommerce REST API, please check the following sources:

Learn how to set up your WooCommerce API key here: https://docs.woocommerce.com/document/woocommerce-rest-api/
Learn how to use WooCommerce REST API with PHP here: https://packagist.org/packages/automattic/woocommerce
Learn how to use WooCommerce REST API with Postman here: https://github.com/woocommerce/woocommerce/wiki/Getting-started-with-the-REST-API
Learn more about WooCommerce REST API here: https://woocommerce.github.io/woocommerce-rest-api-docs/

Wholesale Data Properties In API』s Response
WWPP API introduces a new wholesale_data property in the response to group all wholesale data. This property contains:

Attribute
Type
Description
Available On

wholesale_price
array
The Wholesale Prices set on the backend
Simple, Variation

variable_level_wholesale_minimum_order_quantity
array
The Parent Product Wholesale Minimum Order Quantity
Variable

wholesale_minimum_order_quantity
array
The Wholesale Minimum Order Quantity
Simple, Variation

variable_level_wholesale_order_quantity_step
array
The Parent Product Wholesale Order Quantity Step
Variable

wholesale_order_quantity_step
array
The Wholesale Order Quantity Step
Simple, Variation

wwpp_product_wholesale_visibility_filter
array
The Restrict To Wholesale Roles for Simple and Variable, the Wholesale Exclusive Variation for Variation
Simple, Variable, Variation

wwpp_ignore_cat_level_wholesale_discount
string
The Disregard Product Category Level Wholesale Discount option
Simple, Variable

wwpp_ignore_role_level_wholesale_discount
string
The Disregard Wholesale Role Level Wholesale Discount option
Simple, Variable

wwpp_enable_quantity_discount_rule
string
The Enable further wholesale pricing discounts based on quantity purchased? option
Simple, Variable, Variation

wwpp_quantity_discount_rule_mapping
array
The Product Quantity Based Wholesale Pricing rules
Simple, Variable, Variation

wholesale_price
The wholesale_price property contains the wholesale price set on the backend/product editor, not the calculated wholesale price. The response is formatted like this:
"wholesale_price": {
"": ""
}
Example of the response:
"wholesale_price": {
"gold_role": "50",
"wholesale_customer": "100"
}
variable_level_wholesale_minimum_order_quantity
The variable_level_wholesale_minimum_order_quantity property contains the Parent Product Wholesale Minimum Order Quantity set on the backend/product editor. Please note that this option only available for the Variable (parent) products. The response is formatted like this:
"variable_level_wholesale_minimum_order_quantity": {
"": ""
}
Example of the response:
"variable_level_wholesale_minimum_order_quantity": {
"gold_role": "5",
"wholesale_customer": "10"
}
wholesale_minimum_order_quantity
The wholesale_minimum_order_quantity property contains the Wholesale Minimum Order Quantity set on the backend/product editor. It』s the same as variable_level_wholesale_minimum_order_quantity, but for Simple Products and Variations. The response is formatted like this:
"wholesale_minimum_order_quantity": {
"": ""
}
Example of the response:
"wholesale_minimum_order_quantity": {
"gold_role": "5",
"wholesale_customer": "10"
}
variable_level_wholesale_order_quantity_step
The variable_level_wholesale_order_quantity_step property contains the Parent Product Wholesale Order Quantity Step set on the backend/product editor. Please note that this option only available for the Variable (parent) products. The response is formatted like this:
"variable_level_wholesale_order_quantity_step": {
"": ""
}
Example of the response:
"variable_level_wholesale_order_quantity_step": {
"gold_role": "2",
"wholesale_customer": "3"
}
wholesale_order_quantity_step
The wholesale_order_quantity_step property contains the Wholesale Order Quantity Step set on the backend/product editor. It』s the same as variable_level_wholesale_order_quantity_step, but for Simple Products and Variations. The response is formatted like this:
"wholesale_order_quantity_step": {
"": ""
}
Example of the response:
"wholesale_order_quantity_step": {
"gold_role": "2",
"wholesale_customer": "3"
}
wwpp_product_wholesale_visibility_filter
The wwpp_product_wholesale_visibility_filter property contains the value of Restrict To Wholesale Roles option for Simple and Variable (parent) products, and Wholesale Exclusive Variation option for Variation. The response is formatted like this:
"wwpp_product_wholesale_visibility_filter": [""]
Example of the response:
"wwpp_product_wholesale_visibility_filter": ["wholesale_customer","gold_role"]
wwpp_ignore_cat_level_wholesale_discount
The wwpp_ignore_cat_level_wholesale_discount property contains the value of Disregard Product Category Level Wholesale Discount option under the Wholesale Pricing Options section. The value is 「yes」 or 「no」. Example of the response:
"wwpp_ignore_cat_level_wholesale_discount": "yes"
wwpp_ignore_role_level_wholesale_discount
The wwpp_ignore_role_level_wholesale_discount property contains the value of Disregard Wholesale Role Level Wholesale Discount option under the Wholesale Pricing Options section. The value is 「yes」 or 「no」. Example of the response:
"wwpp_ignore_role_level_wholesale_discount": "yes"
wwpp_enable_quantity_discount_rule
The wwpp_enable_quantity_discount_rule property contains the value of Enable further wholesale pricing discounts based on quantity purchased? under the Product Quantity Based Wholesale Pricing section. The value is 「yes」 or 「no」. Example of the response:
"wwpp_enable_quantity_discount_rule": "yes"
wwpp_quantity_discount_rule_mapping
The wwpp_quantity_discount_rule_mapping property contains the rules of Product Quantity Based Wholesale Pricing. The response is formatted like this:
"wwpp_quantity_discount_rule_mapping": [
{
"wholesale_role": "",
"start_qty": "",
"end_qty": "",
"price_type": "",
"wholesale_price": ""
}
]
Example of the response:
"wwpp_quantity_discount_rule_mapping": [
{
"wholesale_role": "wholesale_customer",
"start_qty": "10",
"end_qty": "15",
"price_type": "fixed-price",
"wholesale_price": "50"
},
{
"wholesale_role": "gold_role",
"start_qty": "5",
"end_qty": "",
"price_type": "percent-price",
"wholesale_price": "20"
}
]
Wholesale Data Parameters In API Request
WWPP API allows you to provide some parameters to set the wholesale data of a product. The parameters you can use are:

Parameters
Type
Description
Available For

wholesale_price
array
The Wholesale Prices set on the backend
Simple, Variation

wholesale_minimum_order_quantity
array
The Wholesale Minimum Order Quantity
Simple, Variable, Variation

wholesale_order_quantity_step
array
The Wholesale Order Quantity Step
Simple, Variable, Variation

wholesale_visibility_filter
array
The Restrict To Wholesale Roles for Simple and Variable, the Wholesale Exclusive Variation for Variation
Simple, Variable, Variation

ignore_cat_level_wholesale_discount
string
The Disregard Product Category Level Wholesale Discount option
Simple, Variable

ignore_role_level_wholesale_discount
string
The Disregard Wholesale Role Level Wholesale Discount option
Simple, Variable

wholesale_quantity_discount_rule_mapping
array
The Product Quantity Based Wholesale Pricing rules
Simple, Variable, Variation

wholesale_price
The wholesale_price parameter is used to set the wholesale prices. The wholesale price value should be an integer.
The parameter data is formatted like this:
"wholesale_price": {
"":
}
Example of the request:
"wholesale_price": {
"gold_role": 50,
"wholesale_customer": 100
}
The current behavior of this parameter:1. If you provide empty string for the _wholesale_price_ parameter, it will be ignored as if you don』t set _wholesale_price_ parameter at all.2. If you provide non-wholesale role keys (regular customer or non-existing roles), it will be ignored. It will only input wholesale price with a valid wholesale role.3. If you provide string or empty string value as the wholesale price, it will be ignored. It will only input integer wholesale price.
wholesale_minimum_order_quantity
The wholesale_minimum_order_quantity parameter is used to set the Parent Product Wholesale Minimum Order Quantity option for Variable (parent) products or Wholesale Minimum Order Quantity option for Simple products and Variations. The minimum order quantity value should be an integer.
The parameter data is formatted like this:
"wholesale_minimum_order_quantity": {
"":
}
Example of the request:
"wholesale_minimum_order_quantity": {
"gold_role": 5,
"wholesale_customer": 10
}
The current behavior of this parameter:

If you provide empty string for the _wholesale_minimum_order_quantity_ parameter, it will be ignored as if you don』t set _wholesale_minimum_order_quantity_ parameter at all.
If you provide non-wholesale role keys (regular customer or non-existing roles), it will be ignored. It will only input minimum order quantity with a valid wholesale role.
If you provide string or empty string value as the minimum order quantity, it will be ignored. It will only input integer minimum order quantity.

wholesale_order_quantity_step
The wholesale_order_quantity_step parameter is used to set the Parent Product Wholesale Order Quantity Step option for Variable (parent) products or Wholesale Order Quantity Step option for Simple products and Variations. The order quantity step value should be an integer.
The parameter data is formatted like this:
"wholesale_order_quantity_step": {
"":
}
Example of the request:
"wholesale_order_quantity_step": {
"gold_role": 2,
"wholesale_customer": 3
}
The current behavior of this parameter:

If you provide empty string for the _wholesale_order_quantity_step_ parameter, it will be ignored as if you don』t set _wholesale_order_quantity_step_ parameter at all.
If you provide non-wholesale role keys (regular customer or non-existing roles), it will be ignored. It will only input order quantity step with a valid wholesale role.
If you provide string or empty string value as the order quantity step, it will be ignored. It will only input integer order quantity step.

wholesale_visibility_filter
The wholesale_visibility_filter parameter is used to set the value of Restrict To Wholesale Roles option for Simple and Variable (parent) products, and Wholesale Exclusive Variation option for Variation.
The parameter data is formatted like this:
"wholesale_visibility_filter": [""]
Example of the request:
"wholesale_visibility_filter": ["wholesale_customer","gold_role"]
The current behavior of this parameter:

 If you provide empty string for the _wholesale_visibility_filter_ parameter, it will remove the restriction set previously
If you provide non-wholesale role keys (regular customer or non-existing roles), it will be ignored. It will only save valid wholesale roles.
The wholesale role keys you provide will replace the previous restriction set. So if you have 「Wholesale Customer」 set in your restriction, sending a request with 「gold_role」 won』t add it to the restriction but replace it entirely. So now your restriction is set to 「Gold Role」 only.

ignore_cat_level_wholesale_discount
The ignore_cat_level_wholesale_discount parameter is used to set the value of Disregard Product Category Level Wholesale Discount option under the Wholesale Pricing Options section. The value should be either 「yes」 or 「no」.
Example of the request:
"ignore_cat_level_wholesale_discount": "yes"
The current behavior of this parameter:

If you provide empty string for the _ignore_cat_level_wholesale_discount_ parameter, it will be ignored as if you don』t set _ignore_cat_level_wholesale_discount_ parameter at all.
If you provide value other than 「yes」 or 「no」, it will be ignored as if you don』t set _ignore_cat_level_wholesale_discount_ parameter at all.

ignore_role_level_wholesale_discount
The ignore_role_level_wholesale_discount parameter is used to set the value of Disregard Wholesale Role Level Wholesale Discount option under the Wholesale Pricing Options section. The value should be either 「yes」 or 「no」.
Example of the request:
"ignore_role_level_wholesale_discount": "yes"
The current behavior of this parameter:

If you provide empty string for the _ignore_role_level_wholesale_discount_ parameter, it will be ignored as if you don』t set _ignore_role_level_wholesale_discount_ parameter at all.
If you provide value other than 「yes」 or 「no」, it will be ignored as if you don』t set _ignore_role_level_wholesale_discount_ parameter at all.

Wholesale_quantity_discount_rule_mapping (Variable Product)
The wholesale_quantity_discount_rule_mapping parameter is used to set the rules of Product Quantity Based Wholesale Pricing. Please keep in mind the below format is designed for Variable product only.
The wholesale_quantity_discount_rule_mapping properties:

Attribute
Type
Description

wholesale_role
string
The wholesale role key

start_qty
string
The start quantity for the rule to active

end_qty (optional)
string
The end quantity for the rule to active

price_type
string
The discount rule type. The value should be 「fixed-price」 or 「percent-price」

wholesale_price
string
The discount price or percentage

The parameter data is formatted like this:
"wholesale_quantity_discount_rule_mapping": [
{
"wholesale_role": "",
"start_qty": "",
"end_qty": "",
"price_type": "",
"wholesale_price": ""
}
]
Example of the request:
"wholesale_quantity_discount_rule_mapping": [
{
"wholesale_role": "wholesale_customer",
"start_qty": "10",
"end_qty": "15",
"price_type": "fixed-price",
"wholesale_price": "50"
},
{
"wholesale_role": "wholesale_customer",
"start_qty": "16",
"end_qty": "",
"price_type": "fixed-price",
"wholesale_price": "40"
},
{
"wholesale_role": "gold_role",
"start_qty": "5",
"price_type": "percent-price",
"wholesale_price": "20"
}
]
The current behavior of this parameter:

If you provide empty string for the _wholesale_quantity_discount_rule_mapping_ parameter, it will remove the rules set previously
If you provide non-wholesale role keys (regular customer or non-existing roles) for the _wholesale_role_ property, it will ignore that particular rule.
If you provide non-number value for the _start_qty_ property, it will ignore that particular rule.
If you provide non-number value for the _end_qty_ property, it will ignore that particular rule. You are allowed to set the _end_qty_ property with empty value, though.
If you provide value other than 「percent-price」 for the _price_type_ property, it will ignore that particular rule.
If you provide non-number value for the _wholesale_price_ property, it will ignore that particular rule.
The only optional property is the _end_qty_. Leaving it out or set it to empty means the rule will be active when the quantity is higher than _start_qty_.
The quantity discount rules you provide will replace the previous rules set. If you want to add additional rules, don』t forget to provide the existing rules in your request data too.

wholesale_quantity_discount_rule_mapping (Simple Product and Variation)
The wholesale_quantity_discount_rule_mapping parameter is used to set the rules of Product Quantity Based Wholesale Pricing. Please keep in mind the below format is designed for the Simple Product and Variation.
The wholesale_quantity_discount_rule_mapping properties:

Attribute
Type
Description

wholesale_role
string
The wholesale role key

start_qty
integer
The start quantity for the rule to active

end_qty (optional)
integer
The end quantity for the rule to active

price_type
string
The discount rule type. The value should be 「fixed-price」 or 「percent-price」

wholesale_price
integer
The discount price or percentage

The parameter data is formatted like this:
"wholesale_quantity_discount_rule_mapping": [
{
"wholesale_role": "",
"start_qty": "",
"end_qty": "",
"price_type": "",
"wholesale_price": ""
}
]
Example of the request:
"wholesale_quantity_discount_rule_mapping": [
{
"wholesale_role": "wholesale_customer",
"start_qty": 10,
"end_qty": 15,
"price_type": "fixed-price",
"wholesale_price": 50
},
{
"wholesale_role": "wholesale_customer",
"start_qty": 16,
"end_qty": "",
"price_type": "fixed-price",
"wholesale_price": 40
},
{
"wholesale_role": "gold_role",
"start_qty": 5,
"price_type": "percent-price",
"wholesale_price": 20
}
]
The current behavior of this parameter:

If you provide empty string for the _wholesale_quantity_discount_rule_mapping_ parameter, it will remove the rules set previously
If you provide non-wholesale role keys (regular customer or non-existing roles) for the _wholesale_role_ property, it will ignore that particular rule.
If you provide non-integer value for the _start_qty_ property, it will ignore that particular rule.
If you provide string value for the _end_qty_ property, it will ignore that particular rule. You are allowed to set the _end_qty_ property with empty value, though.
If you provide value other than 「fixed-price」 or 「percent-price」 for the _price_type_ property, it will ignore that particular rule.
If you provide non-integer value for the _wholesale_price_ property, it will ignore that particular rule.
The only optional property is the _end_qty_. Leaving it out or set it to empty means the rule will be active when the quantity is higher than _start_qty_.
The quantity discount rules you provide will replace the previous rules set. If you want to add additional rules, don』t forget to provide the existing rules in your request data too.

Using the WWPP REST API
To use WWPP REST API, the endpoints should be based on this URL:
/wp-json/wc/v3/wholesale
So when you want to use the Products endpoint, you will need to access it via /wp-json/wc/v3/wholesale/products.
Create a wholesale product
This API helps you create a wholesale product but not regular product (product that doesn』t have wholesale price). Please note that a variable product doesn』t have wholesale prices property (only the variation), so it』s possible to create a variable product without specifying the wholesale prices.
HTTP request
POST /wp-json/wc/v3/wholesale/products
Example
POST: /wp-json/wc/v3/wholesale/products
{
"name":"Wholesale Product",
"type":"simple",
"regular_price":"150",
"wholesale_price":{
"wholesale_customer":140,
"gold_role":110
},
"wholesale_visibility_filter":[
"wholesale_customer",
"gold_role"
],
"ignore_cat_level_wholesale_discount":"yes",
"ignore_role_level_wholesale_discount":"yes",
"wholesale_minimum_order_quantity":{
"wholesale_customer":5,
"gold_role":10
},
"wholesale_order_quantity_step":{
"wholesale_customer":2,
"gold_role":3
},
"wholesale_quantity_discount_rule_mapping":[
{
"wholesale_role":"wholesale_customer",
"start_qty":10,
"end_qty":20,
"price_type":"fixed-price",
"wholesale_price":100
}
]
}
Retrieve a wholesale product
This API lets you retrieve and view a specific wholesale product by ID. Just like the Create API, it won』t retrieve a regular product.
HTTP request
GET /wp-json/wc/v3/wholesale/products/
Available parameters

Parameter
Type
Description

wholesale_role
string
The wholesale role you want to filter the product with. When a product doesn』t have a wholesale price for the particular role, it will show 「Not a wholesale product」 response.

Example
GET: /wp-json/wc/v3/wholesale/products/123?wholesale_role=wholesale_customer
List all wholesale products
This API helps you to view all the wholesale products. Just like retrieving a specific wholesale product, it won』t retrieve regular products.
HTTP request
GET /wp-json/wc/v3/wholesale/products/
Available parameters

Parameter
Type
Description

wholesale_role
string
The wholesale role you want to filter the products with.

Example
GET: /wp-json/wc/v3/wholesale/products?wholesale_role=wholesale_customer
Update a wholesale product
This API lets you make changes to a product. Currently there』s no restriction when updating a product using this API, so you can update regular products or wholesale products.
HTTP request
PUT /wp-json/wc/v3/wholesale/products/
Example
PUT: /wp-json/wc/v3/wholesale/products/123
{
"name":"Updated Wholesale Product",
"wholesale_price":{
"wholesale_customer":140,
"gold_role":110
},
"wholesale_visibility_filter":[
"wholesale_customer",
"gold_role"
],
"ignore_cat_level_wholesale_discount":"yes",
"ignore_role_level_wholesale_discount":"yes",
"wholesale_minimum_order_quantity":{
"wholesale_customer":5,
"gold_role":10
},
"wholesale_order_quantity_step":{
"wholesale_customer":2,
"gold_role":3
},
"wholesale_quantity_discount_rule_mapping":[
{
"wholesale_role":"wholesale_customer",
"start_qty":10,
"end_qty":20,
"price_type":"fixed-price",
"wholesale_price":100
}
]
}
Delete a wholesale product
This API helps you delete a wholesale product. So you won』t be able to use this API to a regular product.
HTTP request
DELETE /wp-json/wc/v3/wholesale/products/
Available parameters

Parameter
Type
Description

wholesale_role
string
The wholesale role you want to filter the product with. If the product doesn』t have wholesale price for the specific role, the API won』t delete the product.

Example
DELETE: /wp-json/wc/v3/wholesale/products/123
Create a wholesale product variation
This API helps you to create a new wholesale product variation. Like the API to create a wholesale product, it doesn』t allow you to create a regular product variation.
HTTP request
POST /wp-json/wc/v3/wholesale/products//variations/
Example
POST: /wp-json/wc/v3/wholesale/products/123/variations/234
{
"regular_price":"150",
"wholesale_price":{
"wholesale_customer":140,
"gold_role":110
},
"wholesale_visibility_filter":[
"wholesale_customer",
"gold_role"
],
"wholesale_minimum_order_quantity":{
"wholesale_customer":5,
"gold_role":10
},
"wholesale_order_quantity_step":{
"wholesale_customer":2,
"gold_role":3
},
"wholesale_quantity_discount_rule_mapping":[
{
"wholesale_role":"wholesale_customer",
"start_qty":10,
"end_qty":20,
"price_type":"fixed-price",
"wholesale_price":100
}
]
}
Retrieve a wholesale product variation
This API lets you retrieve and view a specific wholesale product variation by ID. This API can』t be used to retrieve a specific regular product variation.
HTTP request
GET /wp-json/wc/v3/wholesale/products//variations/
Available parameters

Parameter
Type
Description

wholesale_role
string
The wholesale role you want to filter the variations with. When a variation doesn』t have a wholesale price for the particular role, it will show 「Not a wholesale product」 response.

Example
GET: /wp-json/wc/v3/wholesale/products/123/variations/234?wholesale_role=wholesale_customer
List all wholesale product variations
This API helps you to view all the wholesale product variations in a variable product. If a variation retrieved is not a wholesale product variation, The API won』t list it.
HTTP request
GET /wp-json/wc/v3/wholesale/products//variations
Available parameters

Parameter
Type
Description

wholesale_role
string
The wholesale role you want to filter the products with.

Example
GET: /wp-json/wc/v3/wholesale/products/123/variations?wholesale_role=wholesale_customer
Update a wholesale product variation
This API lets you make changes to a product variation. Currently there』s no restriction for updating via this API, so you can update both regular or wholesale product variations.
HTTP request
PUT /wp-json/wc/v3/wholesale/products//variations/
Example
PUT: /wp-json/wc/v3/wholesale/products/123/variations/234
{
"wholesale_price":{
"wholesale_customer":140,
"gold_role":110
},
"wholesale_visibility_filter":[
"wholesale_customer",
"gold_role"
],
"wholesale_minimum_order_quantity":{
"wholesale_customer":5,
"gold_role":10
},
"wholesale_order_quantity_step":{
"wholesale_customer":2,
"gold_role":3
},
"wholesale_quantity_discount_rule_mapping":[
{
"wholesale_role":"wholesale_customer",
"start_qty":10,
"end_qty":20,
"price_type":"fixed-price",
"wholesale_price":100
}
]
}
Delete a wholesale product variation
This API helps you delete a wholesale product variation.
HTTP request
DELETE /wp-json/wc/v3/wholesale/products//variations/
Available parameters

Parameter
Type
Description

wholesale_role
string
The wholesale role you want to filter the product with. If the product doesn』t have wholesale price for the specific role, the API won』t delete the product.

Example
DELETE: /wp-json/wc/v3/wholesale/products/123/variations/234
Known Issues And Future Improvements
Here are the known bugs and future improvements we are planning to the API integration:

Unable to create wholesale product without providing the wholesale prices, even though the general/role level discount is set or when the product has wholesale category. When a product has wholesale category or the general/role level discount is set, it should count the product as a wholesale product and allow the creation of it.
Include the calculated wholesale prices (final price including tax calculation) and the generated HTML for the wholesale pricing in the API response

Note
Wholesale products vs regular products
Wholesale products are products that have a wholesale price defined. This wholesale price can be set in some places such as on the product itself, on the category, or on the general settings.
For a product to be called a wholesale product, one of these conditions should be true:

The product has wholesale prices set to at least one wholesale role
The product has category with wholesale discount set
The general/role discount is set in 「WooCommerce > Settings > Wholesale Prices > Discount」

See here for a more complete run down of pricing in Wholesale Suite.

How To Restrict Wholesale Customers To Use Particular Payment Gateways

How To Restrict Wholesale Customers To Use Particular Payment Gateways

A recent feature addition to WooCommerce Wholesale Prices Premium that has proven very popular is the ability to restrict your wholesale customers so that they must use particular payment gateways. We call this payment gateway mapping.
It』s especially handy when you want to provide wholesale only payment gateways (like bank transfer for instance) or if you want to stop them using a particular payment method (such as PayPal).
Here』s what the interface looks like:
Restrict Wholesale Payment Gateways
When a wholesale user is detected we refer to the mapping you set in this interface to determine which payment gateway options they should see at checkout.
Restrict Payment Gateway Selection For Wholesale Customer
Once the mapping is added it will reflect in the bottom table where you can easily edit or delete it:
Restrict Payment Gateway Mapping Table
NOTE: When you add a mapping for a wholesale role, you must add all the payment gateways they are allowed to use. These are the only gateways that they will see at the checkout.
It』s very flexible – you can even map your wholesale roles to payment gateways that are normally disabled. This makes it possible to enable certain gateways just for your wholesale customers and leave them disabled for regular customers.

How To Make Wholesale Only Menu Items

How To Make Wholesale Only Menu Items

We have a lot of questions on what』s the best way to provide quick access to wholesale order form or registration form. The easiest way is to provide the navigation menu link for your wholesale customer in your main navigation menu.

However, some store owners don』t want this to be visible for anyone and just for the wholesale customer. You can use the Nav Menu Roles plugin to restrict this menu to appear for logged-in wholesale customers only.
Once activating it, you』ll have additional options in your menu option. Navigate to Appearance > Menu check this out. For example, you only want to have the Wholesale Ordering menu appear for the wholesale customer.

Here』s what it』ll look on the front-end for non-logged in customers:

What Is Your Refund Policy?

What Is Your Refund Policy?

Thank you for enquiring about our refund policy.
We like to keep things pretty simple, so our refund policy is very straightforward. Here is the summary:
If you find that within 14 days of your purchase you require a refund, we are happy to give it as long as you get in touch with our support team to discuss the issue.
For the full terms of the refund policy please see our terms of service document.
If you have any questions regarding this policy, please don』t hesitate to get in touch.
If you feel you require a refund, all we ask is that you contact support to discuss the issue.