How to send a different New Order email subject for Wholesale Orders

How to send a different New Order email subject for Wholesale Orders

By default, all of the new order emails will use the same email template for both retail and wholesale orders. Unfortunately, we don』t have the feature to override this yet.
The workaround that we can do to distinguish the retail and wholesale order on the new order email is by adding the order type in the subject line. You can do this by adding the following snippet to your child theme』s function.php
// Custom New Order Subject - Adding the Order Type in the Subject Line
add_filter('woocommerce_email_subject_new_order', 'wwpp_change_email_subject', 1, 2);

function wwpp_change_email_subject($subject, $order) {

//getting the blogname scaping special chars for email
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$order->get_id();
$order_type = $order->get_meta('_wwpp_wholesale_order_type'); // The Order data

// creating our new subject line
$subject = sprintf('[%s] Order # %s - %s', $order_type, $order->get_id(), $blogname);

// sending our custom subject back to WooCommerce
return $subject;
}

How to Add Wholesale Role Selection to The Wholesale Registration Form

How to Add Wholesale Role Selection to The Wholesale Registration Form

Our WooCommerce Wholesale Prices Premium plugin has a feature to create multiple wholesale customer roles. You can define the wholesale prices, restrict shipping methods, and restrict payment gateway for each role.
By default, our Wholesale Registration Form will grant your potential wholesale customer role to a selected default user role of your choice. You can find it in WooCommerce > Settings > Wholesale Lead > General > New Lead Role.
If you』d like your potential wholesale customer to select their own wholesale customer role, you can use the following snippet. Please add it to your child theme』s function.php:

function my_wwlc_auto_select_role ($user) {
//get the selected role
$selected_role = get_user_meta($user->ID, 'wwlc_cf_select_role', true);
$defaultRole = get_option( 'wwlc_general_new_lead_role' );
if ($selected_role) {
$user->remove_role( $defaultRole );
$user->add_role( $selected_role );
}
}
add_action( 'wwlc_action_after_approve_user', 'my_wwlc_auto_select_role' );

You』d need to create a custom field for Wholesale Customer role selection first. In this sample, the custom field ID is wwlc_cf_select_role and for each value for the option is the meta key for that user role. eg: wholesale_vip.

Wholesale Role Selection Sample Setup

WooCommerce Wholesale Prices (Free Plugin) Getting Started Guide

WooCommerce Wholesale Prices (Free Plugin) Getting Started Guide

WooCommerce Wholesale Prices Free Version

This document is a getting started guide for the free WooCommerce Wholesale Prices plugin for WooCommerce.
Firstly, welcome aboard! You are about to start on an exciting journey. Adding wholesale to your WooCommerce store is one of the best decisions you could make for your e-commerce business.
Here』s what this guide will cover:

Overview – we describe what the plugin does
Wholesale Customer Role – we』ll explain what the wholesale customer role is
Setting Wholesale Prices – we show you how to configure wholesale prices for your products
Testing – we show you how to test those prices with a wholesale test account
Settings – an overview of the settings available in the free plugin
Advanced Features – what is available in the Premium version and it can do for you in addition to the free plugin

Overview
The free version of WooCommerce Wholesale Prices is a fully functional and legitimate way to add wholesale features and will suit many businesses that only require basic wholesale functions. It』s a great way to start with wholesale on your WooCommerce store.
There is also a Premium add-on for the free plugin which adds additional features as well as other plugins in the suite that add features like wholesale order forms and user management.
You can read all about those here.
What the free WooCommerce Wholesale Prices plugin does:

Adds a new user role for wholesale level customers
Lets you set basic wholesale pricing at the product level
Gives you some basic settings to customize common features

With these three things, you can implement wholesale in your WooCommerce store.

Subscribe to Wholesale Suite

The above is an introductory video but below, we』ll show you the new Wholesale Customer role and what that all means. So don』t just watch the video and leave, read on so get the full picture.
Wholesale Customer Role
The first concept to understand is the new Wholesale Customer user role that the plugin adds.
Normally, customers in your store will have the 「Customer」 user role. You can see this if you go to the backend of your website, click on Users->All Users, then click one of your customers.

Normal Customer

WooCommerce Wholesale Prices adds a new user role called 「Wholesale Customer」 so it can identify which customers who should have wholesale pricing.

Wholesale Customer

You can give wholesale pricing access to any customer simply by changing their user role to the Wholesale Customer role.
Want to change the words 「Wholesale Customer」 to something else? Maybe something like 「Trade Customer」 or similar? You can do this under WooCommerce->Wholesale Roles.

WooCommerce Wholesale Roles

WooCommerce Wholesale Roles Editing

Next, let』s look at how to set wholesale pricing on a product.
Setting Wholesale Prices
In the free plugin, you can set wholesale pricing via the Product edit screen. You might notice in the screenshot below that you see the wording 「Wholesale Customer ($):」 on the field.

Adding Wholesale Price To WooCommerce Products

This is because what we』re actually doing here is setting the wholesale price for that Wholesale Customer user role.
When you define a wholesale price, the price is related to the user role that you are setting it for.
In the free plugin, there is only one user role (the Wholesale Customer role) but this is an important concept to understand because you can add more wholesale role levels in WooCommerce Wholesale Prices Premium.
Click here to read a full guide on how to set wholesale pricing which covers all the options of the premium plugin as well.
Once a wholesale price has been set for the Wholesale Customer role you』ll need to test it is working, so let』s look at how to do that.
Testing
Because wholesale prices are attached to a specific user role, only users with that role are able to see the wholesale prices on your products that you』ve set for that role.
With that in mind, to test your wholesale pricing on the front end of your site you need to log in with a wholesale test account.
First, you need to create a new user. To do this login to your dashboard, click Users->Add New, give the user the Wholesale Customer user role.

Adding A New Wholesale User

Chrome Incognito

Next, open up a new Private Browsing or Incognito window. This will give you a fresh logged out browser session.
Visit your website and log in with the new test user you just created.
Visit the product where you have set wholesale pricing and you should see the wholesale price there.
Next, we』ll take a quick look at some of the settings available in the free plugin.
Settings
The settings on the free plugin are pretty light because most of the functionality is covered by the product edit screen and the user role as described above.
There are a number of settings available for basic customizations.
You can find these settings by logging into your dashboard, go to WooCommerce->Settings, Wholesale Prices tab.
There are a number of sub-menus in the settings area:

The first screen you will land on is the General sub-menu which contains the following settings:

Setting Name
What It Does

Disable Coupons For Wholesale Users
Stops your wholesale level customers using coupons

The second sub-menu is the Price sub-menu which contains the following settings:

Setting Name
What It Does

Wholesale Price Text
Lets you change the front end text shown to users for the wholesale price on product listings

Hide Original Price
Hides the regular price from wholesale customers so the only price they see if the wholesale price

The third sub-menu is the Upgrade sub-menu which describes some of the features available in WooCommerce Wholesale Prices Premium.
And that brings me to the final part of this guide, getting more advanced with your wholesale operation…
Advanced Features
Setting basic wholesale prices is just the beginning. There is so much more to setting up a wholesale component to your store and if you』re serious about utilizing wholesale sales to grow your business then you should consider what we have to offer in the rest of the Wholesale Suite.
WooCommerce Wholesale Prices Premium

View Plugin Features

View Plugin Features

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 Order Form

View Plugin Features

WooCommerce Wholesale Order Form Plugin

The time it takes for a wholesale customer to place an order is one of the biggest pain points you can eliminate.
Wholesale customers are not like regular retail customers. They don』t want to sift through your normal shop pages adding products to cart that way. They need a tabular form-based interface that makes it fast to add products to the cart in the quantities they desire.
This is where the Order Form plugin comes in.
Top Feature Highlights:

Your whole catalog on one page – searchable and categorized
No page reloads, full ajax enabled so wholesalers can add to cart without leaving the page
Slimline tabulated interface that is mobile & tablet friendly
Wildcard keyword & SKU searching
Hierarchical category filter
Permissions control so only those allowed can access the form

These are just a few high-level features that you』ll give your wholesale customers by using the Order Form plugin.
WooCommerce Wholesale Lead Capture

View Plugin Features

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.
The Wholesale Suite Bundle

Wholesale Suite Bundle

View Plugin Bundle

If you buy all three of our WooCommerce wholesale plugins together, in the Wholesale Suite Bundle, you』ll be giving your wholesale customers an amazing experience alongside your retail store.
These extensions are designed to grow your business:

Easily add wholesale pricing to your products
Streamline your wholesale ordering process
Manage your wholesale level customers

It』s the best collection of WooCommerce wholesale extensions on the market that you can trust your wholesale operation with.
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 Exclude a Product from Wholesale Percentage Discount.

How to Exclude a Product from Wholesale Percentage Discount.

Giving a percentage-based discount is the best solution if you need a quick way to apply discounts to your products. But, sometimes you might want to retain the regular price for some products. For example, maybe because it is currently low in stock or you want to promote other similar products.
For that reason, we give you the option to exclude certain products from wholesale percentage discounts.
It is very simple, you only need to open the product page and go to the Publish configuration on the sidebar on the right and you will find the Wholesale Pricing Options. 

Wholesale Pricing Option

You can either exclude the product from the percentage-based wholesale discount per product category level or per role level or both.
Once you have checked the box, it will ignore the wholesale percentage discount that you have set.

How to Translate Fields on the Registration Page

How to Translate Fields on the Registration Page

Translations or availability of other languages is really important, especially for the Wholesale Registration Page. Fortunately, all of our Wholesale Suite plugins are optimized for translation. It contains translation strings that can be translated to any language that is supported by WordPress.
The easiest way to translate the built-in fields is by using Loco Translate, PoEdit or WPML.
In Loco Translate, you should be able to find the strings on Loco Translate > Plugins > WooCommerce Wholesale Lead Capture and translate it.
(click to zoom)
(click to zoom)
Using WPML, go to  WPML > Theme and plugins localization > WooCommerce Wholesale Lead Capture > String Translation.
Translating Custom Fields
Since the custom fields are user created fields, it must be translated manually by using custom hooks, then add it to your functions.php.
In the example below, you need to change the Field ID, language code, and translation.

add_filter( "wwlc_registration_form_fields", function( $registration_form_fields ) {

$registration_form_fields2 = $registration_form_fields; foreach( $registration_form_fields as $key1 => $field ) {

// target the id of type content

if( $field[ 'id' ] == 'wwlc_cf_bussiness_info' ) {

switch (ICL_LANGUAGE_CODE) {
case "en": //language code

if( isset( $field['default_value'] ) )

$registration_form_fields2[ $key1 ][ 'default_value' ] = "

Tell us about your business

"; //translation break;

case "fr": if( isset( $field['default_value'] ) ) $registration_form_fields2[ $key1 ][ 'default_value' ] = "

Your French Translation

"; //translation break; }

}
}

return $registration_form_fields2; } , 10 , 90);

Usage Tracking (What Is Tracked & Why)

Usage Tracking (What Is Tracked & Why)

Are you curious about usage tracking in Wholesale Suite? Usage tracking helps our team to better understand our users and their website needs by looking at a range of variables in their Wholesale Suite plugins, WordPress, and web host.
This information allows us to continuously improve our product as well as our QA/testing process. In this article, we』ve shared the details that Wholesale Suite collects through usage tracking and why we track this information.
Important
The only sensitive data we store is the site URL and email address of the opted-in WordPress user. We do not track or store any personal or business-critical data neither from you nor your site users. We keep track of the name and email address simply to get in touch regarding potential issues or updates that would be relevant to you. Tracking data is automatically sent to our servers once you opt-in and then every 7 days thenceforth (for as long as the plugin is active or you choose to opt-out).
What Is Tracked & Why?
Below is the list of information that Wholesale Suite collect as part of the usage tracking:
Wholesale Suite

Versions and activation status of Wholesale Suite plugins – So we know which versions of each of our Wholesale Suite plugins are potentially responsible for issues when we get bug reports, allowing us to identify issues and release solutions much faster.
License details & activation status (paid customers only) – if you』re a Wholesale Suite customer, then we use this to determine if there』s an issue with your specific license key, and to link the profile of your site with the configuration to allow us to determine if there』s issues with your Wholesale Suite configuration.
Wholesale Suite plugin settings – Know which settings people are using allows us to determine potentially which new settings or areas of Wholesale Suite people want us to expand on, and which settings people aren』t using so we can make the interfaces more streamlined and usable.
Usage tracking config – The Wholesale Suite option that contains the information on when the usage tracking data-sync will happen (once a week), so we can gauge the server load for the usage tracking servers.

WordPress

Theme/Plugin names and versions – So we know which themes and plugins to support and test against. Wholesale Suite runs on over 20k websites. While we can』t test with all 50,000+ plugins in the WordPress/WooCommerce universe, we do our best to test against the top plugins and themes from this list.
Site and user count and is multisite – This allows us to gauge how important it is to support specific types of multisites like multi-network and similar styles of configuration and gauge how much we need to scale our servers before launching features. Knowing the sub-site count helps us ensure Wholesale Suite scales properly for large networks.
Locale – We want Wholesale Suite to be accessible to everyone, and knowing the site』s locale helps us focus our translation efforts.
Timezone – We have users across the globe, so knowing the densities within various time zones helps us provide the best support coverage possible.
Site URL – The website address allows us to properly store usage tracking records so that we can avoid duplicated details.
WordPress/WooCommerce versions – knowing which versions of WordPress and WooCommerce our customers are using helps us better tune compatibility with differences in those particular versions. It also helps us identify gaps in our testing/QA processes.

Server

PHP and MySQL Versions – These details help us make sure our testing procedures have proper coverage to avoid compatibility issues.
Server Software – This reports if the web server software is Apache, Nginx, or similar, which is used for testing purposes.

Frequently Asked Questions
Q: How do I opt into (or out of) usage tracking?
The answer to this question depends on whether you』re using the paid or free version of Wholesale Suite.
If you have a paid license with Wholesale Suite, then you will be default be opted into usage tracking. To disable this, please reach out to support and they will happily help out.
If you』re using WooCommerce Wholesale Prices (free plugin) and would like to enable usage tracking so that our team can keep making our product better, then please go to WooCommerce > Settings > Wholesale Prices > Help. On this screen, you』ll need to check the Allow Usage Tracking checkbox.

How To Change The 「Wholesale Price: 」 Text On The Front End

How To Change The 「Wholesale Price: 」 Text On The Front End

One common thing people want to do is change the bit of text that shows before the price on your wholesale prices. This defaults to 「Wholesale Price:」
In the WooCommerce Wholesale Prices Premium plugin, you can change this text to anything you want. For example, Reseller Price.
You can find this option in WooCommerce > Settings > Wholesale Prices > Price > Wholesale Price Text.

If you have a multiple user role and would like to customize this text for each roles, you can use the following snippet:
add_filter('wwp_filter_wholesale_price_title_text', 'override_wholesale_text', 10, 1);

function override_wholesale_text($wholesaletext) {
global $current_user;

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

if (!empty($wwp_wholesale_role) && in_array('wholesale_customer', $wwp_wholesale_role)) {
// Where 'wholesale_customer' is the name of the wholesale role you want to target
return 'Wholesale Price:';
}

if (!empty($wwp_wholesale_role) && in_array('wholesale_vip', $wwp_wholesale_role)) {
// Where 'wholesale_vip' is the name of the wholesale role you want to target
return 'VIP Price:';

}

}
}

How To Let Wholesale Customers Pay Via Invoice Rather Than Regular Gateways

How To Let Wholesale Customers Pay Via Invoice Rather Than Regular Gateways

While our Wholesale Suite plugins themselves don』t create a special way for users to get billed via an Invoice rather than having to pay, we have created a new plugin to introduce an Invoice payment gateway on your store. This will allow your wholesale customers to pay via Invoice terms rather than on the spot with credit card.
Step 1: Create an 「Invoice」 Payment Gateway (Free Plugin)
We created a free plugin to do this properly called Invoice Gateway for WooCommerce. This plugin introduces a new payment gateway to allow users to pay via Invoice.
It places the order into Processing status so you can then generate an invoice in your accounting system and send it to the user. Once generated, you can log the invoice number on the Order.
Once the order is marked Complete it will also record the invoice number on the order complete/customer invoice email.
The plugin also has facilities for adding the purchase order number during checkout.
Step 2: Restrict the Invoice Payment Method
The second part of the puzzle is to allow wholesale customers access and you can do this with the WooCommerce Wholesale Prices Premium plugin by setting up a mapping between your wholesale role/s and the required payment gateways.
A full guide on payment gateway mapping can be found here.

Navigate to WooCommerce->Settings
Click the Wholesale Prices tab
Click the Payment Gateways sub menu

Invoice Payment Gateway Wholesale

From here wholesale users can submit orders just like anyone else via the regular WooCommerce system which is very handy if you have any integrations with your accounting system as the orders get created just like everyone else.

How to change the default product quantity to 0 on the Wholesale Order Form

How to change the default product quantity to 0 on the Wholesale Order Form

By default, the Wholesale Order Form displays each product quantity as 1, unless you have set a Minimum Order Quantity to your products. The reasoning for this is it reduces the number of clicks or typing involved when ordering (since you can』t order 0 of something, it will be at least 1). The Order Form is all about speed ordering so this fits with that mindset.
However, we』ve received some requests from the past that they want to see the quantity starting from 0 instead. Unfortunately, we don』t support this feature as a setting but you can do it as a code snippet.
Using the custom snippet below will set the default value to 0, however, this only affects simple products on the Wholesale Order Form.
Please copy the snippet below and put it on your theme/child theme』s functions.php.

add_action('wwof_action_before_product_listing', function () {
add_filter('woocommerce_quantity_input_args', function ($input_args, $product) {
$input_args['input_value'] = 0;
return $input_args;
}, 10, 2);
});

add_filter('wwof_filter_product_item_quantity', function ($quantity_field, $product) {
$quantity_field = str_replace('input_value="1"', 'input_value="0"', $quantity_field);
return $quantity_field;
}, 10, 2);

If you』ll need further customization, I』d recommend asking for assistance from a developer and I』d suggest looking at Codeable.

How To Edit The Registration Form

How To Edit The Registration Form

A major component of the WooCommerce Wholesale Lead Capture plugin is the ability to sign up new wholesale customers using a special customized registration form.
This form, by default, captures more nuanced information from your potential customers than the regular WooCommerce customer registration process (which just requires email and password).
Built-in Fields
Default in-built fields on the registration form are:

First Name (required)
Last Name (required)
Email (required)
Username (optionally required)
Password (optional) (optionally required)
Phone (optionally required)
Company Name (optional) (optionally required)
Address (optional) (optionally required)
Terms and Conditions (optionally required)

You can adjust the display order of the form fields by tweaking the form order on each field.
Lead Capture』s Built-in Fields (Click to Zoom)
Custom Fields
The registration form can be easily customized.
In addition to the in-built form fields, you can add additional custom fields yourself and the data will be recorded against the user for viewing later.
This can be especially helpful when using the approvals system as you can collect data to be used in deciding if a user should be allowed to have an account or not.
To add a custom field, you need to enter:

Field Name (Displayed to the user)
Field ID (The name of the user meta in the database. Must be unique. This is handy to know when exporting/importing users)
Field Type (Currently supported types are: Text, Text Area, Number, Email, URL, Select, Radio, Checkbox)
Required (If the field should be required)
Enabled (Enable the field to be included in the form on the front end)

Lead Capture Custom FieldsLead Capture Custom Fields