If you’re setting up a wholesale store for your business or for your clients, WooCommerce is a great choice! It’s free, open-source, powerful, and growing in popularity.
However, many important wholesale functions are missing, and that’s particularly important when it comes to wholesale pricing. Let’s explore how we can set up complex pricing in WooCommerce, and in detail:
- Setting up different prices for different users
- Tiered pricing and pricing table
- Bulk pricing and discounts
- Discounts by quantity or order value
Each functionality can be added via a free or premium plugin or, if you’re familiar with PHP, even by code. Either way, this article will feature one of the many options available.
1. Different Prices for Wholesalers, Resellers and Business Customers
There are several free wholesale plugins out there that will allow you to create multiple roles/groups (such as wholesalers, resellers, businesses, etc.) and set different pricing for each group for each product.
For example, you can do it through the lite version of B2BKing which is freely available on WordPress.org. After installing the plugin, each simple product and each variation gets additional price fields for the different groups in the product backend:
In the configuration above, guests and regular customers see a price of $45, whereas customers that are in the Resellers group will see $35 after they log in for the same item. The free version of the plugin is limited to 2 groups, while the premium version allows an unlimited number.
You can assign each user to a group in their profile page, to control who sees which price:
Groups can be created and managed in the plugin’s Groups panel:
This free plugin also allows payment and shipping methods control, so you can make certain methods (e.g. Invoice Payment) available to only selected or pre-approved customers. This is managed for each group in the group page:
Setting up wholesale pricing through code snippets
Below are the hooks you need to set a fixed regular price for simple products as well as variations. A single function is necessary. The method below requires that you set a meta value to identify wholesale users by (‘b2bking_b2buser’ in the snippet) and a meta value that contains the wholesale price (‘b2bking_wholesale_price’ in the snippet).
// Simple Products
add_filter( 'woocommerce_product_get_price', 'b2bking_individual_pricing_fixed_price', 999, 2 );
add_filter( 'woocommerce_product_get_regular_price', 'b2bking_individual_pricing_fixed_price', 999, 2 );
// Variations
add_filter('woocommerce_product_variation_get_regular_price', 'b2bking_individual_pricing_fixed_price', 999, 2 );
add_filter( 'woocommerce_product_variation_get_price', 'b2bking_individual_pricing_fixed_price', 999, 2 );
add_filter( 'woocommerce_variation_prices_price', 'b2bking_individual_pricing_fixed_price', 999, 2 );
add_filter( 'woocommerce_variation_prices_regular_price', 'b2bking_individual_pricing_fixed_price', 999, 2 );
function b2bking_individual_pricing_fixed_price( $price, $product ){
$user_id = get_current_user_id();
$is_b2b_user = get_user_meta( $user_id, 'b2bking_b2buser', true );
if ( $is_b2b_user === 'yes' ){
// Search if there is a specific price set for wholesalers
$b2b_price = get_post_meta( $product->get_id(), 'b2bking_wholesale_price', true );
if ( ! empty( $b2b_price ) ){
return $b2b_price;
}
}
return $price;
}
2. Tiered Pricing and Pricing Table
Through tiered pricing you can set different prices for quantity ranges. For example the cost of a product can be $100 for purchases between 1-10 units, $90 for purchases between 11-20 units and $80 for purchases of more than 20 units.
This kind of setup is common in wholesale e-commerce and encourages customers to place larger orders.
This can be easily set up with the Premium version of B2BKing by setting minimum quantity and price in each product’s page:
And here’s what this looks like in the front-end of the site. B2BKing has also automatically generated a tiered pricing table showing customers the different prices they can get by ordering larger quantities.
The tiered pricing table is optional and can be controlled through settings. Each single product, and each variation can have its own separate table.
Setting up dynamic pricing through code snippets
There are several Business Bloomer snippets that could achieve tiered pricing by user role, such as WooCommerce: Set / Override Product Price Programmatically – in this case you can define a “discount percentage” for a user role and avoid touching the settings.
3. Bulk Pricing and Discounts
Besides tiered pricing, another way to set bulk pricing is through discounts for quantity or size, for categories or products. B2BKing (in both free and premium versions) allows you to set discounts through a system of dynamic rules.
For example, let’s see how we can set a discount for 10% for business customers, when the user places an order above $1000.
You could also set discounts for specific products or specific categories only, for a group of customers, or even for a single individual customer.
Setting up bulk pricing through code snippets
There are several Business Bloomer snippets that implement bulk pricing, such as WooCommerce: Bulk Dynamic Pricing Without a Plugin – in this case you can define product prices based on their cart quantity.
4. Product Visibility in Wholesale Sites
Another common way to set up wholesale catalogs in WooCommerce is to create 2 different types of products:
- Single products
- Product boxes / cartons / crates
Depending on the business model, you can have both in the same site, but occasionally, particularly for Hybrid B2B & B2C sites, you may want to have single products visible to individual customers, and cartons/boxes visible to wholesalers.
This can be controlled for each product and category with the premium plugin version through a simple control panel in the product and category page:
Controlling product / category visibility through custom code
To hide products, you can hook into the ‘woocommerce_product_query’ action hook and control directly which products are visible.:
add_action( 'woocommerce_product_query', 'b2bking_product_visibility' );
function b2bking_product_visibility( $q ){
// calculate available product ids and place them in an array
$product_ids_array = array( 15, 267, 322 );
// set these products as the only ones visible.
$q->set( 'post__in', $product_ids_array );
// alternatively use the post__not_in argument to hide specific products.
}
5. B2BKing – Ultimate Wholesale Plugin for WooCommerce
B2BKing is a featured item and weekly bestseller on CodeCanyon (Envato Market). It aims to be a complete solution for b2b and wholesale stores, with over 137+ features including:
- Wholesale Registration with Custom Fields
- VAT VIES Validation
- Invoice Payment Gateway
- Wholesale Order Form
- Private Store Functionality
- Purchase Lists
- Dynamic Pricing
- Multiple Buyers on Account
- Messaging System
- Hidden Products, Catalog Control
- Offer Bundles and Negotiated Offers
- Request a Quote
- and much more!
Clear and easy to follow. Thanks for sharing!
Cool!