By default the archives pages in WooCommerce (Categories, Tags and even the main Shop page archive) do not display a quantity selector and have hard coded the add to cart buttons to a quanitty of 1.
This is fine for retail situations, but for wholesale customers it can be confusing when there is a minimum quantity amount on that particular product and the price doesn』t match up in the cart due to not satisfying this rule.
The best way to get around this is by adding a quantity box to your archive pages. The WooCommerce Wholesale Prices Premium plugin will then pick up on this and adjust the minimum quantity to the amount you defined in your product.
Here』s a quick guide on how to override your loop/add-to-cart.php template to achieve this:
https://docs.woothemes.com/document/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/
Now you should see quantity selectors next to your add to cart buttons and when logged in, your wholesale customers will see the correct min quantity pre-filled in those boxes.
Author 詩語
Quantity Based Tiered Pricing for Product Categories Guide
Product categories can apply a quantity based tiered % discount beyond the defined base wholesale % discount to all eligible products in the cart that belong to that product category.
The quantity based tiered % discount pricing structure applies to these eligible products based on the sum total of all products in that category that are in the cart, even if some products belong to other categories as well (and are applying % rates from other categories) or are using product based prices.
Please refer here for a detailed explanation of the hierarchy of how pricing is applied in WooCommerce Wholesale Prices.
The best way to illustrate how quantity based tiered pricing on categories affects products on the cart is with a few examples:
Example #1: Tiers apply to the sum of all products from that category in the cart
Category 1 has a base wholesale % discount of 20%.
It also has a quantity based tiered % discount for quantity 10 – 100 which gives the customers 50% off instead.
Product A and Product B both belong to Category 1.
Product A』s regular retail price is $100. Product B』s regular retail price is $150.
Neither product has a wholesale price set on the product and therefore will be using category % based pricing.
If the cart contains:
Product A – 6
Product B – 3
No quantity based tiered % discounts will apply to either product. Only the base wholesale % discount for the category applies.
Product A – $80 each
Product B – $120 each
However, if the cart is updated to contain:
Product A – 6
Product B – 5
The sum of all products from Category 1 in the cart is greater than the 10 minimum of the tiered discount and therefore the quantity based tiered % discount (50% off) will apply.
Product A – changes to $50 each
Product B – changes to $75 each
Example #2: Tiers apply to the sum of all products, even if some products aren』t using those tiers themselves
Category 1 has a base wholesale % discount of 20%.
It also has a quantity based tiered % discount for quantity 10 – 100 which gives the customers 50% off instead.
Product A and Product B both belong to Category 1.
Product A』s regular retail price is $100. Product B』s regular retail price is $150.
Product A does not define a wholesale price on the product and therefore will be using category % based pricing.
Product B does define a wholesale price of $125.
If the cart contains:
Product A – 6
Product B – 3
No quantity based tiered % discounts will apply to either product. Only the base wholesale % discount for the category applies.
Product A – $80 each
Product B – $125 each
However, if the cart is updated to contain:
Product A – 6
Product B – 5
The sum of all products from Category 1 in the cart is > than the 10 minimum of the tiered discount, and therefore the quantity based tiered % discount (50% off) will apply.
Product A – changes to $50 each
Product B – stays at $125 each
Product B』s price does not change because, as per the pricing hierarchy, once a wholesale price is defined on the product category % discounts do not apply.
However, it』s presence in the cart means it does still count towards the sum of all products from each of it』s categories. It』s presence in the cart may affect the pricing of other products in the cart in the same category that are using category % discounts.
Example #3: Products that belong to multiple categories count towards the sum total of products in all their categories
Category 1 has a base wholesale % discount of 20%.
Category 2 has a base wholesale % discount of 10%
Category 1 also has a quantity based tiered % discount for quantity 10 – 100 which gives the customers 50% off instead.
Product A belongs to Category 1 only.
Product B belongs to Category 1 and Category 2.
Product A』s regular retail price is $100. Product B』s regular retail price is $150.
Neither product has a wholesale price set on the product and therefore will be using category % based pricing.
The global setting for 「Category Wholesale Discount」, which determines which category to use when a product belongs to multiple categories, is set to use the 「Lowest」 % discount.
If the cart contains:
Product A – 6
Product B – 3
No quantity based tiered % discounts will apply to either product. Only the base wholesale % discount for the category applies.
Product A will use Category 1』s base wholesale % discount of 20%, while Product B will use Category 2』s base wholesale % discount of 10% (the lower of the two that Product B belongs to).
Product A – $80 each
Product B – $135 each
However, if the cart is updated to contain:
Product A – 6
Product B – 5
The sum of all products from Category 1 in the cart is greater than the 10 minimum of the tiered discount,and therefore the quantity based tiered % discount (50% off) will apply.
Product A – changes to $50 each
Product B – stays at $135 each
Product B』s price does not change because it is using the base wholesale % discount from Category 2.
However, it does still count towards the sum of all products from each of it』s categories and it』s presence may affect the pricing of products in the same category that are using category % discounts.
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.
How To Map Multiple Shipping Methods Within The Same Region
The Issue:
A common issue regarding Wholesale Role/Shipping Method Mapping is when you have multiple shipping methods with 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.
For example, you want to have a Flat Rate shipping method for retail customers and Free Shipping for wholesale customers in the United States.
Multiple shipping zones with the same region, incorrect way
The Solution:
Instead of having them separated, combine all the Shipping methods with the same Region as shown in the picture below. This way, the Wholesale Role/Shipping Method Mapping can be applied properly.
The correct way of having multiple shipping methods in the same region
For additional reference, please visit the link to learn more on How To Restrict Wholesale Customers to Using Particular Shipping Methods.
How To Give A Further Discount Off Wholesale Price When Product Is In A Certain Category
In some cases you might like to setup a special 「Wholesale On Sale」 product category which houses items that give a further discount based on the Wholesale Price, not the Regular Price.
Instead of having to manually adjust prices or percentage points, it』s possible to do this in code to give a further discount on the wholesale price for items that appear in this 「Wholesale On Sale」 category.
Note that I』m specifically talking about giving the discount off the wholesale price, not the regular price. For adjusting the % off the regular price use the product category percentage discounts feature for that.
This is intended as an advanced tutorial and should only be implemented if you have a good understanding about User roles and Product Categories terms.
Add the following code snippet to your functions.php and adjust the category slug (I』ve used 「wholesale-on-sale」 here) and the percentage off you wish to give (0.5 is used here for 50% off). You can also add more 「else if」 conditions to test for other role or other categories too.
/**
* Add further discount on top of a product's wholesale price.
* The function below give a further discount on the wholesale price for items in the "Wholesale On Sale" category.
* Important Note: Please adjust this functions code accordingly to fit your needs.
*/
function wwppAddDiscountToSaleCategory( $wholesalePrice , $product_id , $userWholesaleRole ) {
// Get all the category slugs this product belongs to
$terms = wp_get_post_terms( $product_id, 'product_cat' );
$categories = array();
foreach ( $terms as $term )
$categories[] = $term->slug;
/**
* Check if this product is under the "wholesale-on-sale" product category.
* Assuming that we wanted to apply 50% off on all products under this category on top of their existing wholesale price
* Please change 'wholesale-on-sale' category accordingly to fit your needs.
*/
if ( in_array( 'wholesale-on-sale', $categories ) ) {
/**
* Check if the current user have a role of 'wholesale_customer'.
* Assuming we wanted to have this effect on all users under 'wholesale_customer' role.
* Please change the role accordingly to fit your needs.
*/
if ( in_array( 'wholesale_customer', $userWholesaleRole ) ) {
/**
* In this example we are using 50% discount off from the product existing "wholesale price".
* Please change accordingly to fit your needs.
*/
if ( is_array( $wholesalePrice ) && isset( $wholesalePrice[ 'wholesale_price' ] ) )
$wholesalePrice[ 'wholesale_price' ] = $wholesalePrice[ 'wholesale_price' ] - ( $wholesalePrice[ 'wholesale_price' ] * 0.5 );
else
$wholesalePrice = $wholesalePrice - ( $wholesalePrice * 0.5 );
}
// You can add more else if conditions here if you want to test for other wholesale roles
}
// you can add more else if conditions here to test for other product categories
return $wholesalePrice;
}
add_filter( 'wwp_filter_wholesale_price_shop_v2', 'wwppAddDiscountToSaleCategory', 100, 3 );
add_filter( 'wwp_filter_wholesale_price_cart', 'wwppAddDiscountToSaleCategory', 100, 3 );
// You only need to uncomment this if you are using WooCommerce Wholesale Prices plugin lower than verison 1.6.x
// If you are on the latest version of our plugins, no need to uncomment this code to improve performance
// add_filter( 'wwp_filter_wholesale_price', 'wwppAddDiscountToSaleCategory', 100, 3 );
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:
How to tax exempt a wholesale role
Sometimes when you run a store with multiple roles you will need to make a special wholesale role for some customers that is tax exempt. This can be useful for ensuring those users are never taxed regardless of the country they are in.
In WooCommerce Wholesale Prices Premium we have made this quite easy to achieve by introducing tax exemption mapping. This allows you to map the tax status to any of your wholesale roles (click here to learn how to add extra wholesale roles).
You will find these settings under WooCommerce->Settings, Wholesale Prices tab, then click on Tax in the submenu.
Simple select the wholesale role, then choose whether it should be exempt or not. Feel free to map only the roles that are tax exempt or if you want to be explicit you can map them all.
We recommend creating a special test user with your tax exempt role to let you test and ensure that things are working the way you want them to be. If it』s mapped correctly you should see that this user will have no tax applied to their wholesale prices.
Override Wholesale Only Shipping Setting For Certain Shipping Methods
In WooCommerce 2.6.0 shipping zones were introduced which prompted us to release a new version of WooCommerce Wholesale Prices Premium with enhanced shipping mapping controls.
One of those enhancements is to do with a setting called Wholesale Only Shipping Methods which hides all mapped shipping methods from non-wholesale customers.
This is an important feature to allow admins to hide shipping methods that are exclusively for wholesale customer use. A common example of this might be Local Pickup which might only be offered to wholesale customers.
As of 1.9.5, for advanced users, we have also added a new filter which lets you selectively choose to override this setting and expose certain shipping methods to non-wholesale customers.
The idea here is that you enable the setting because that is the default behaviour, but there might be certain shipping methods that you actually do want to expose to customers.
You can use this filter to achieve that by putting the following code into your functions.php file in your theme.
To make all non-zoned shipping methods available:
// Allow all non-zoned shipping methods to be available to regular users
function allowMappedNonZonedMethodsForRegularUsers( $allow, $shipping_method ) {
if ( ! $shipping_method->supports( 'shipping-zones' ) )
$allow = true;
return $allow;
}
add_filter( 'wwpp_force_allow_mapped_shipping_method_for_non_wholesale' , 'allowMappedNonZonedMethodsForRegularUsers', 10, 2 );
Or for a specific non-zoned shipping method:
// Allow non-zoned shipping method "Advanced Free Shipping" only to be available to regular users
function allowAdvancedFreeShippingForNonWholesale( $allow, $shipping_method ) {
if ( ! $shipping_method->supports( 'shipping-zones' ) && $shipping_method->id == 'advanced_free_shipping' )
$allow = true;
return $allow;
}
add_filter( 'wwpp_force_allow_mapped_shipping_method_for_non_wholesale' , 'allowAdvancedFreeShippingForNonWholesale', 10, 2 );
Need to allow a different shipping method other than Advanced Free Shipping?
Just use the ID key of your shipping method, eg. UPS shipping method is 『ups』, USPS is 『usps』 and so on.
Contact your developer to find out what the ID of the shipping method is you need.
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:
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.
Once the mapping is added it will reflect in the bottom table where you can easily edit or delete it:
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 Keep Retail Prices Showing Including Tax When Wholesale Price Is Set To Show Excluding Tax
When a wholesale customer visits the product page, the default view is that they see the regular price crossed out with the wholesale price.
Our WooCommerce Wholesale Prices Premium has a feature to allow your wholesale customers to view a separate tax display to your shop, cart, and checkout pages.
For example, you can set Including Tax to regular price and set Excluding Tax to your wholesale prices. However, if you set excluding tax to your wholesale customers, they will also see the crossed out regular price with excluding tax.
So if you want to keep the regular price with including tax, you just need to use this custom snippet and put it to your theme/child theme』s functions.php.
global $wc_wholesale_prices_premium;
remove_filter( 'option_woocommerce_tax_display_shop' , array( $wc_wholesale_prices_premium->wwpp_tax, 'wholesale_tax_display_shop' ) );
remove_filter( 'option_woocommerce_tax_display_cart' , array( $wc_wholesale_prices_premium->wwpp_tax, 'wholesale_tax_display_cart' ) );
Now, when wholesale customers check your wholesale products, the crossed out regular price will display including tax while your wholesale price shows ex tax.