How to Style the Wholesale Registration and Log in Form

How to Style the Wholesale Registration and Log in Form

We』ve received a lot of request asking on how to style or customize the Wholesale Registration Form.
Unfortunately, we don』t have control of how our Wholesale Lead Capture forms will appear on the customer』s site. The WooCommerce Wholesale Lead Capture Forms includes some default styling based on WooCommerce used tags. And the styling basically relies on the active theme that is currently being used.
If you』d like to make some minor styling changes on the Wholesale Registration Form, a good way to modify them is by using custom CSS.
Listed below are some of the basic styling that you can use to modify your Wholesale Registration Form. You』ll need to put them on your theme/child theme』s style.css file to take effect.

/* Add another column */
div#wwlc-registration-form {
column-count: 2;
column-gap:60px;
}
/* Adjust the country field top margin*/
p#wwlc_country_field{
margin-top: 100%;
}
/* Adjust the country field dropdown size*/
#wwlc-registration-form span.select2-selection{
width:100%;
}
/* Adjust the field size and color */
#wwlc-registration-form .input-text.wwlc_form_field{
width:100%;
height:30px;
background-color: #f1f1f1;
}
If you don』t have an experience modifying custom CSS codes, I suggest checking other guides like this one which can help you modify your theme more efficiently.
Please note that extensive styling customization is not part of the plugin』s support scope. If you』re looking for further customization, we recommend hiring a designer/developer. And if you』re interested to hire one, we suggest someone from Codeable.

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 Reorder Fields on the Registration Page

How To Reorder Fields on the Registration Page

You can adjust the field order on most of the fields in our wholesale registration. You can set this in the Wholesale Lead setting under the built-in fields menu.
Wholesale Lead Built-in Fields Setting
However, the address field has a default field order. A common request we have had is how to reorder the country or state field so it』ll appear after a certain field. You can use the following snippet to do that:
add_action('init', function() {
global $WWLC_REGISTRATION_FIELDS;
$WWLC_REGISTRATION_FIELDS['wwlc_country']['field_order'] = '6.6';
});
You can adjust the snippet by changing the wwlc_country to any field meta you want to change and the 6.6 for the field order.

How to hide/disable the add to cart button based on product type

How to hide/disable the add to cart button based on product type

If you』re looking for a way to restrict your wholesale user from purchasing products with a specific product type, for example, you want to prevent them from purchasing simple products, variable products or even product bundles, you can do that by using a custom snippet.
The snippet below is an example to hide the add to cart button on the product and product catalog page. It checks if the logged in user is a wholesale customer based on the wholesale role key and if it is a simple product. Then it hides/disables the add to cart button.
 
add_action('wp','wwp_remove_add_to_cart_on_product_type', 99);

function wwp_remove_add_to_cart_on_product_type() {
global $current_user;
$product = wc_get_product();

if (isset($current_user) && class_exists('WWP_Wholesale_Roles')) {
$wwp_wholesale_roles = WWP_Wholesale_Roles::getInstance();
$wwp_wholesale_role = $wwp_wholesale_roles->getUserWholesaleRole();

//Checks if the logged in user is wholesale_customer
if (!empty($wwp_wholesale_role) && in_array('wholesale_customer', $wwp_wholesale_role)) {

// Change the product type, in this example it is 'simple' for simple products
if ( $product instanceof WC_Product && $product->is_type( 'simple' ) ) {
// This filter will disable the add to cart button
add_filter( 'woocommerce_is_purchasable', '__return_false');
}
}
}
}

 
If you wish to hide these products from your WooCommerce Wholesale Order Form, you』ll need to do an additional step to hide them. You can go to  WooCommerce > Settings > Wholesale Ordering > Filters, and add the products in the Exclude Product Filter.
 
Exclude Product Filter, WooCommerce Wholesale Order Form

User Registration & Approval Emails Workflow

User Registration & Approval Emails Workflow

Now that you have the WooCommerce Wholesale Lead Capture plugin up and running, it』s time to configure your email.
This guide will give you an overview of how the emails flow in your new wholesale registration system.
There are two options for the approval scenarios:

Manual Approval Required
Automatic Approval

Auto Approve New Leads Setting
You』ll find both of these options in WooCommerce > Settings > Wholesale Lead > General > Lead Actions.
Scenario #1: Manual Approval Required

User registers
Account set to inactive
email Admin receives an email of a new registration
email User receives an email confirming their registration which contains their credentials
Admin approves the new user manually
Account set to active
email User receives email that their account is active

Scenario #2: Automatic Approval

User registers
Account set to active
email Admin receives an email of new registration and that it has been auto-approved
email User receives an email confirming their registration which contains their credentials
email User receives an email that their account is active 

Having trouble getting or sending the email?

If you』re having trouble getting or sending the emails, please check our troubleshooting steps here.

How To Fix Pagination Numbers Being Stacked Up

How To Fix Pagination Numbers Being Stacked Up

On some themes, the pagination numbers on the WooCommerce Wholesale Order Form will not inherit the proper styles from WooCommerce.
We』ve found this to be a common enough problem that we have created some workaround CSS code.
In many themes, there is a box in the theme options for inserting custom CSS. Otherwise, look to add the following in your style.css file in your theme.
ul.page-numbers {
list-style: none;
text-align: center;
padding: 1em 0;
}

ul.page-numbers li {
display: inline-block;
list-style: none;
}

How To Add A Please Select Option To Custom Dropdown Fields

How To Add A Please Select Option To Custom Dropdown Fields

Custom fields in WooCommerce Wholesale Lead Capture let you add custom fields of many different types to your wholesale customer registration form.
Dropdown fields, in particular, are very powerful for forcing users to select from pre-defined options.
If you wish you can also add a 「— Please Select —」 which will have no value and therefore not pass validation if you mark the field required.
Instructions:
Add this option to your custom dropdown add your dropdown field via the custom fields interface in the settings (WooCommerce->Settings, Wholesale Lead, Custom Fields sub page) as per normal.
Then, add a new option to the list, giving it a display name such as 「— Please Select —」 while leaving the Option Value field empty.
Finally, move the field to the top of the list.
Adding a please select field to custom dropdowns
If you want to force users to select one of the options, ensure you have the 「Required」 setting enabled.
On the front end you will see your field like so (validation failure is shown):
Front end Please Select option

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.

WooCommerce Wholesale Order Form Getting Started Guide

WooCommerce Wholesale Order Form Getting Started Guide

WooCommerce Order Form

Thank you for purchasing the WooCommerce Wholesale Order Form!
This document is a getting started guide for the WooCommerce Wholesale Order Form plugin for WooCommerce. 
Based on tons of research and observing wholesale transactions we know that happy wholesale customers are profitable wholesale customers. And the quicker your wholesale customers can order, the happier they』ll be because their mission is to get in, make the order, and get out.
The Wholesale Order Form is all about providing an efficient one-page ordering form for your wholesale customers so you can fulfill that promise.
Here』s what this guide will cover:

Overview – we describe at a high level what the plugin does exactly
Choosing Your Display Style – we will show the two different ways you can display your form and why you might want each
Paginated or Lazy Load – the pros and cons of using pagination versus lazy load to handle more products than can fit on a single page
Extra Columns  – there』s a number of extra columns you can add to your form to help your customers
Search/Filtering Options – this important because it helps your customers find what they』re after in the form interface
Getting Help – we understand this can be an intricate tool, we』ll show you where to get help if you need it

Overview
WooCommerce Wholesale Order Form is a completely stand-alone plugin for WooCommerce that provides a highly optimized ordering interface. It』s designed to work hand in hand with the rest of our suite of tools.
There are hundreds of features included in the Order Form tool, you can see here for a full list, but today we』ll go over just a few of the major features so that you can get up and running as fast as possible.

Subscribe to Wholesale Suite

First, we』re going to make some high-level decisions about how to display the form.
Choosing Your Display Style
There are two display styles in the Order Form, each with their advantages and disadvantages – we call them:

Standard (Add to cart per row)
Alternate (Add to cart at bottom)

Wholesaler Order Form Display Style

The standard mode displays the form with add to cart buttons on the right-hand side of each row. This has a number of advantages:

It』s faster for the customer
Fewer mouse clicks (every mouse click adds time and frustration)
It』s all AJAX so no page reloading happens when clicked

Wholesale Order Form Standard Style

The alternate mode displays the form with checkboxes next to the products on the right-hand side of each row and a single Add To Cart button at the bottom of the form which adds all the selected products to the cart in one go. This also has advantages:

Customers can add products all at once
Feels more like a traditional order sheet
Also fully AJAX driven so doesn』t reload the page when clicked

If you use the standard mode we recommend also adding a sidebar to the page so you can add a cart widget. See our guide for that here.
If you choose to use the alternate mode then you should make use of the Show Cart Subtotal setting which shows a simple running total of the cart』s subtotal near the add to cart button at the bottom of the form.
Paginated or Lazy Load
The next display decision you should make is how you want to handle when the form has so many products to show that they spill over to the next page.
By default, the order form will display 12 products per page. This is a pretty common number to load initially and it also applies when the customer is filtering or searching for products.
There are two options for paging style:

Paginated – split results into pages based on the products per page
Lazy Loading – more results are loaded into the page based on the user scrolling

Wholesale Order Form Pagination Lazy Loading

Both options are great so at the end of the day, it』s up to you how you want it to work.
Pagination will show the customer how many pages there is upfront which gives them an indication of the depth of your product catalog.
Lazy Loading just keeps the user scrolling and scrolling down until it runs out of products to show, either in the catalog as a whole or for that particular search.
Extra Columns
Depending on what information you have available on your products you may wish to show some extra columns of data on the table.

Only show the stock quantity if you are tracking stock on your WooCommerce installation or via a compatible system like Inventoroo.
For the product SKU to show you must have it filled in under the Inventory tab on your product data information on the product. Likewise, for variable products, you should have the SKU filled in on each variation.
The product thumbnail will show the thumbnail image of the product and once you have that enabled you』ll also be able to provide an image size for the thumbnail on the form.
Want to add some extra custom data to the form? Then you』ll need to modify the order form template file. If you need a developer to do this we recommend searching on Codeable.
Search/Filtering Options
The last major thing you need to check on initially is searching and filtering options. These settings relate to the searchability and filterability of the order form as well as the sorting.
Do you want products that have zero inventory shown on the form? Do you want to allow customers to search by SKU?
There are also options here for sorting the products by name, date added, SKU and more.

Wholesale Suite Order Form Searching Filtering Options

Advanced Features
When it comes to solving wholesale for WooCommerce we believe in a holistic approach. You need to solve all three of the big problems:

Setting wholesale prices, visibility, tax, etc. This is solved with Prices Premium as you』ve seen in this guide.
Efficient ordering – this is very important and greatly affects the happiness of your customers when they do business with you
Recruiting and managing wholesale level customers

WooCommerce Wholesale Prices Premium

WooCommerce Wholesale Prices Premium Plugin

Premium is the add-on for the free plugin and immediately it opens up a lot of extra features that will give you maximum flexibility.
Additionally, some countries require certain specific rules to be followed when selling and advertising pricing to wholesale customers and Prices Premium has been designed to cater to everyone.
Top Feature Highlights:

Unlimited number of additional wholesale roles
Set prices via global % or category % in addition to the product level pricing
Tax exemption based on user role which is flexible enough to cater for even the most stringent tax policies
Shipping mapping where to can force wholesale customers to use certain methods and you can restrict certain shipping options to only wholesale customers
Payment gateway mapping where you can force wholesale customers to use certain gateways and likewise restrict certain gateways to only wholesale customers
Adjust the visibility of products to be wholesale only, retail only or a mix. This lets you adjust variation visibility as well
Add minimum purchase rules so you can enforce your wholesale agreements on the order level and set sensible minimums on the product level

These are just a few of the hundreds of features inside the premium add-on.
WooCommerce Wholesale Lead Capture

WooCommerce Wholesale Lead Capture Plugin

Managing wholesale level customers can be a bit of a headache if you are doing it manually. The Wholesale Lead Capture plugin gives you a wholesale specific registration form, dedicated wholesale login page, sign up email sequences, and your choice of manual or automated approvals.
It really takes the pain out of manually recruiting & registering wholesale customers which will save you time and let you put wholesale recruitment on autopilot.
Top Feature Highlights:

Registration form builder lets you capture whatever information you need during sign-up
Pre-fill the checkout fields with the information that you capture during sign up to smooth the first-order process for your new wholesale customer
Built-in spam protection with honeypot technology and optionally Google Recaptcha
Automated email sequences for admin and customer-facing approval and notification emails
Complete user approvals system which can be based on manual approvals or 100% automated if you wish

The Lead Capture plugin will make recruiting your wholesale customers and managing them much less painful.
Help & Support
We have a dedicated support team for Wholesale Suite who knows our products, WooCommerce, and the industry very well. You』re welcome to make use of their expertise at any time, worldwide.
If you are an existing customer please go to the support ticket request form and send us a message.
If you are a free plugin user, please send us a support request on the forum, we actively monitor the WordPress.org support forums for the free plugin and help our users there as best as we can.

How To Add Wholesale Ordering link In My Account Page

How To Add Wholesale Ordering link In My Account Page

A common request we have had is how to display a wholesale ordering link on the My Account Page so that wholesale customers see a link to the WooCommerce Wholesale Order Form on the page they land on after they log in.
By using the custom snippet below, you can now include an additional tab for the Wholesale Order Form on the My Account Page.
Just simply edit the URL in the snippet to redirect your customers to your respective Wholesale Order Form URL.
add_filter ( 'woocommerce_account_menu_items', 'wholesale_ordering_link' );
function wholesale_ordering_link( $menu_links ){

$new = array( 'wholesaleorderinglink' => 'Wholesale Ordering Form' );

$menu_links = array_slice( $menu_links, 0, 1, true )
+ $new
+ array_slice( $menu_links, 1, NULL, true );

return $menu_links;

}

add_filter( 'woocommerce_get_endpoint_url', 'wholesale_ordering_hook_endpoint', 10, 4 );
function wholesale_ordering_hook_endpoint( $url, $endpoint, $value, $permalink ){

if( $endpoint === 'wholesaleorderinglink' ) {

// here is the place for your custom wholesale ordering page URL
$url = 'http://localhost/wholesale/wholesale-ordering/';

}
return $url;

}
You can add this custom snippet to your theme/child theme』s functions.php. Afterward, your My Account page should now display the Wholesale Order Form tab.
Wholesale Order Form on My Account PageWholesale Order Form on My Account Page