How to Make a Product Variation Wholesale Exclusive

How to Make a Product Variation Wholesale Exclusive

As a store owner who has both B2B and B2C in one platform, sometimes you have exclusive product variations that you want to sell for your wholesale customers only. Furthermore, you also do not want your regular customers to see wholesale-only product variations.
You can hide product variations from regular customers and make it exclusive to wholesale customers by following the steps below:

Open the product page and scroll down to Product data — Variable product.
Click the Variations section and go to the exclusive product variation 
Scroll down to Wholesale Exclusive Variation to specify which roles are allowed to see and buy the product.

Wholesale Exclusive Variation

Your regular customers should not be able to see the product variation now since you have made it exclusive to your wholesale customers only.

How To Show A List Of Clickable Product Categories Below The Search

How To Show A List Of Clickable Product Categories Below The Search

The WooCommerce Wholesale Order Form allows your customers to perform really quick AJAX driven searches without the need for a page refresh.
If you want to reduce the number of clicks even further, you can use the following snippet of code on your site to display a list of clickable product category links below the search form.
These categories will select the appropriate category in the search form, clear out any keywords, and perform the search for your customer with no further interaction. All just in one click!
Feel free to alter the code to suit your website! It』s very flexible as long as you wrap each one in the tag as shown. For example, you could display all your product categories as a grid of clickable images. The options are only limited by your coding ability 🙂
Drop the following code into your functions.php file in your theme to add a list of clickable product categories:
function wwofCategoriesBeforeListing() {
$args = array(
'taxonomy' => 'product_cat',
'hierarchical' => true,
'hide_empty' => true
);

$all_categories = get_categories( $args );

if ($all_categories) {
foreach ($all_categories as $cat) {
echo '
slug . '" class="wwofCatLink" href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'
';
}

echo '
jQuery(".wwofCatLink").click(function(e) {
e.preventDefault();
var catSlug = jQuery(this).data("cat-slug");
jQuery("select#wwof_product_search_category_filter").val(catSlug);
jQuery("input#wwof_product_search_form").val("");
jQuery("input#wwof_product_search_btn").trigger("click");
});
';

}
}

add_action('wwof_action_before_product_listing', 'wwofCategoriesBeforeListing', 10);

Note: This is an advanced tutorial aimed a website developers as a basic implementation to be altered to fit the your site. Contact your developer directly and send them to this article if you want this installed on your site Order Form.

How To Override Order Form Templates

How To Override Order Form Templates

The WooCommerce Wholesale Order Form gives your wholesale customers a brilliant ordering experience.
But sometimes you need to provide more information or might want to tweak the layout even further beyond what the plugin offers out of the box.
That』s where template overrides come in.
The Order Form plugin lets you override its templates in much the same way as WooCommerce itself does, so those that are familiar with WooCommerce』s template overriding will find this just as simple.
To override a template file:

Navigate to the /wp-content/plugins/woocommerce-wholesale-order-form/templates/ directory
Copy the .php file you wish to override
Paste the file in your theme under a directory called 『woocommerce』. This should look something like: /wp-content/themes/your-theme/woocommerce/[template file to override].php

Template files that you can override:

wwof-product-details.php
This is the popup window when you click a product (if you enable the Display the product details in a lightbox popup on click? option)
wwof-product-listing-filter.php
This is the order form section that holds options like the search box, category filter, search button, etc.
wwof-product-listing.php
This is the default listing (rows)
wwof-product-listing-alternate-lazyload.php
This is the alternate listing when you enable the Use Alternate View Of Wholesale Page? and Disable Pagination? Options
wwof-product-listing-alternate.php
This is the alternate listing when you enable the Use Alternate View Of Wholesale Page? option
wwof-product-listing-lazyload.php
This is the default listing when you enable the Disable Pagination? option

The plugin will search your theme and detect these overrides and use them over the bundled plugin versions.
Keep in mind, when you update the plugin, sometimes template files will need to be updated to keep up with the latest features.

Shortcodes available on the Order Form

Shortcodes available on the Order Form

The WooCommerce Wholesale Order Form is and extremely slimline and efficient way to provide quick ordering tools for your WooCommerce products. We often find people want to expose them to more than just their wholesale customers!
To help facilitate this we have extended the default shortcode with a few extra options which will allow you to customise the look of your form.
The shortcode options currently include:

Hiding/showing the search box
Pre-searching & restricting the form to display products from certain categories
Pre-searching & restricting the form to display only specific products

Here』s what the shortcode that displays the order form looks like by default without any options:
[wwof_product_listing]
To show/hide the search box, simple include the 「show_search」 attribute. This can have a value of 0 to hide the search box or 1 to show it (leaving the attribute out shows the form by default).
[wwof_product_listing show_search=0]
To pre-search a category or categories and restrict the form to only those categories provided, use the 「categories」 attribute. This should contain a comma separated list of Product Category ID』s.
[wwof_product_listing categories="1,2,3,4,5"]
Similarly, to pre-search and restrict the form to a list of specific products provide a comma separated list of Product IDs with the products attribute.
[wwof_product_listing products="1,2,3,4,5"]
You can also combine attributes however you like, but note that restrictions will restrict as much as possible (so if you provide products that don』t don』t appear in the category you specified then they will not show).
[wwof_product_listing show_search=0 categories="5" products="1,2,3"]
eg. If products 1 & 2 do not have the category 5, but 3 does, then only product 3 will show.
Also note that values provided in both the 「categories」 and 「products」 attributes have a higher precedence than the settings under WooCommerce->Settings, Wholesale Ordering, Filters settings area meaning that if you provide it, some of these restricted products or categories would show on your form.
To retrieve the ID of a category:
Simply navigate to the edit screen for that Product Category and read the URL:
Retrieve Product Category ID From URL
To retrieve the ID of a product:
Navigate to the edit screen for that Product and read the URL:
Retrieve Product ID From URL

How to hide the Phone field on the registration page

How to hide the Phone field on the registration page

At the moment, we don』t have an option to hide the Phone field in the Wholesale Registration page.
But you can simply use the CSS code below to hide it. Please put this on your theme』s style.css to apply the change.
#wwlc-registration-form .wwlc_phone {display:none;}

Remember to make sure that the phone field is set to be 『not required』 in the WooCommerce > Settings > Wholesale Lead tab > Built-in Fields sub-menu.

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 Create Multiple Wholesale Registration Pages (Registration Form Shortcode Options)

How To Create Multiple Wholesale Registration Pages (Registration Form Shortcode Options)

By default, the automatically created Wholesale Registration Page contains the shortcode [wwlc_registration_form], which displays the wholesale registration form as defined in the settings.
You can use the same shortcode multiple times and to any part of your site. However, there are some cases where you want to create separate registration pages for different user roles or you want to make a special registration page with auto-approval enabled. This is why we have extra shortcode options that you can use for this kind of requirement.
Wholesale Registration Form for specific user role:
 [wwlc_registration_form role=wholesale_customer]
In the example shortcode above, the user that will register from this Registration form will have the user role for wholesale_customer. You just need to replace the wholesale_customer to the role slug you want (you can find these under WooCommerce->Wholesale Roles).
Auto Approval Registration Form shortcode:
[wwlc_registration_form auto_approve=true]
The shortcode above will automatically approve the users who register from this registration form.
Note: If you need to set both the auto-approval and the user role, you can use both in one shortcode like the example below!
[wwlc_registration_form auto_approve=true role=wholesale_customer]
You can also add custom redirections for your multiple Wholesale Registration pages. For reference, please visit this article to learn more.

How To Change The Add To Cart Label

How To Change The Add To Cart Label

On each line of the WooCommerce Wholesale Order Form you will see the add to cart button (in the standard layout).
Sometimes depending on the naming convention used in your site, the text 「Add To Cart」 on the button might need to be changed and you can do so using a quick filter.
Modify and add the following code to your functions.php file in your theme:
function filterAddToCartLabel($actionHtml , $product , $alternate) {
$actionHtml = str_replace('Add To Cart', 'Add To Order', $actionHtml);
return $actionHtml;
}

add_filter('wwof_filter_product_item_action_controls', 'filterAddToCartLabel', 10, 3);

You can change 「Add To Order」 to whatever you wish your button text to be.

How to improve the loading speed of Wholesale Order Form

How to improve the loading speed of Wholesale Order Form

The loading speed of the Wholesale Order Form depends on a variety of reasons such as the specs of the server, the number of plugins running, the number of products you want to display, and others.
Usually, when Wholesale WooCommerce Prices Premium is active, it takes a much longer time for the Wholesale Order Form to finish loading as it runs through each product to check and calculate its wholesale price and requirements.
Number Of Products Shown
We recommend testing out the loading time and adjust the number of products displayed on your wholesale order form.
Please go to WooCommerce > Settings > Wholesale Ordering > General and set the Products Per Page and adjust based on how you see the form performing on the front end.
Enable Lazy Loading
Lazy Loading uses AJAX to keep the loading of additional products into the form as you scroll down. This is instead of the normal method of paginating the form.

From the customer』s perspective, this might feel speedier depending on the size of your catalog and what their browsing for.
Variable Products
When dealing with variable products, each variation counts individually in the backend process.
This is why it takes time for the WooCommerce Prices Premium to run through each variation to check the wholesale price, visibility, and other per variation requirements.
For example, you might only have 5 products to display if each has 10 variations when the process begins, it』s similar to calculating a total of 50 products to display all at once in the order form page.
While the form is coded to be as efficient as possible when loading products, the more variations your products have on average, the more this might pose a loading speed issue.
This can also be useful to know when calculating the products per page setting that you want to have as it can actually be computing many more times than expected which may cause some slow loading.
Need Help Tweaking?
If you are still running into problems with the loading speed, feel free to reach out to our friendly support team for advice.

How To Add Increment Quantity Plus And Minus (+/-) Buttons On The Order Form (For Non-HTML5 Themes)

How To Add Increment Quantity Plus And Minus (+/-) Buttons On The Order Form (For Non-HTML5 Themes)

Prior to version 2.3.0, WooCommerce decided to change the + and – buttons to HTML5 input where it has up and down button integrated into the field.
However, there are some older/non-HTML5 themes that might not support HTML5 number input boxes and they still show the old plus/minus buttons.
If your theme is showing the + and – buttons on the Wholesale Order Form and they aren』t working or in case that your theme doesn』t display the quantity plus/minus buttons, you can use the custom code below and put it to your theme/child theme』s functions.php. This will display the quantity buttons on your Wholesale Order Form and make the buttons work properly.
// Add plus and minus button
add_filter( 'wwof_filter_product_item_quantity', function($quantity_field){
$quantity_field = str_replace('

', '

', $quantity_field);
$quantity_field = str_replace('

', '

', $quantity_field);
return $quantity_field;
}, 99, 2 );
/* Allow to increate quantity by pressing plus and minus button
*
* Based on WooCommerce Quantity Increment plugin
* (https://github.com/woocommerce/WooCommerce-Quantity-Increment)
*/
add_action( 'wp_footer', function() {
global $post;
if( isset( $post->post_content ) && has_shortcode( $post->post_content , 'wwof_product_listing' ) ) { ?>

(function($) {

$(document).ready(function(){

function wwof_refresh_quantity_increments(){
$( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '' ).prepend( '' );
}
$( document ).on( 'updated_wc_div', function() {
wwof_refresh_quantity_increments();
} );
$( document ).on( 'click', '.plus, .minus', function() {

// Get values
var $qty = $( this ).closest( '.quantity' ).find( '.qty'),
currentVal = parseFloat( $qty.val() ),
max = parseFloat( $qty.attr( 'max' ) ),
min = parseFloat( $qty.attr( 'min' ) ),
step = $qty.attr( 'step' );
// Format values
if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0;
if ( max === '' || max === 'NaN' ) max = '';
if ( min === '' || min === 'NaN' ) min = 0;
if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN' ) step = 1;
// Change the value
if ( $( this ).is( '.plus' ) ) {
if ( max && ( currentVal >= max ) ) {
$qty.val( max );
} else {
$qty.val( currentVal + parseFloat( step ) );
}
} else {
if ( min && ( currentVal 0 ) {
$qty.val( currentVal - parseFloat( step ) );
}
}
// Trigger change event
$qty.trigger( 'change' );
});
wwof_refresh_quantity_increments();
});
})(jQuery);
<?php
}
} );
Wholesale Order Form with HTML5 input
Wholesale Order Form Quantity Plus and Minus Buttons (This inherit』s your theme』s styling so please style accordingly)