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 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 remove the theme shortcodes appearing on the Lightbox Popup

How to remove the theme shortcodes appearing on the Lightbox Popup

The lightbox popup is a feature of the WooCommerce Wholesale Order Form, where the lightbox is generated when the product is clicked in the order form instead of redirecting it to the product page.

It copies the content of the product description and displays it in the lightbox. However, it is common for popular theme builders like Visual Composer, Divi, and others, to use shortcodes in the editor but they don』t provide support the content displayed in our lightbox pop-up. This is why shortcodes are not executed and only the styling shortcodes are displayed.
The best workaround for this is by modifying the lightbox pop-up to display the short description instead of the default product description.
To do this, you will have to modify the template file wwof-product-details.php line 55 on woocommerce-wholesale-order-form/templates/.  For reference on how to edit the order form templates, please click here.
You should find this line of code:
echo do_shortcode( wpautop( $product_post_data->post_content ) );

Please replace it with the following code:
echo nl2br("nn",false);
echo do_shortcode( $product_post_data->post_excerpt );

This way, you don』t have to worry about the extra shortcodes displaying on your lightbox popup!

How To Force Success Tick Mark To Stay Visible After Add To Cart

How To Force Success Tick Mark To Stay Visible After Add To Cart

If you want to force the tick mark to stay visible after the customer has added an item to cart you can do so with a small CSS tweak.
This can be good for using the tick as an indicator they』ve already added the item to the cart. Note though that it will revert if they search or refresh the page.
Add the following to your custom styles in your theme:
#wwof_product_listing_table .product_row_action .spinner.success {
display: inline-block !important;
}

How To Modify The — No Category Filter — Text On The Category Filter Dropdown

How To Modify The — No Category Filter — Text On The Category Filter Dropdown

By default on the Wholesale Order Form, the drop-down filter for categories will display — No Category Filter — to indicate when the form is not being filtered by category.
No Category Filter Drop Down
Some customers have requested the text be changed, but this isn』t unanimous as some people like this wording.
So to help those who want to change the text, we』ve wrapped it in a filter which makes it easy to alter with a small snippet of code.
Add the following code to your functions.php file in your theme and adjust the wording according to your needs:
function modify_no_category_filter_text () {
return "--Whatever Text You Want Here--";
}

add_filter( "wwof_filter_listing_no_category_filter_text" , "modify_no_category_filter_text" );

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 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)

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 Stop Wholesale Customers From Purchasing Until They Reach The Minimum Requirements

How To Stop Wholesale Customers From Purchasing Until They Reach The Minimum Requirements

Running a wholesale side to your business is a great way to handle large volume orders and reward your customers for buying in bigger quantities.
But we all know that sometimes you need to enforce certain rules for wholesale customers to ensure that they』re meeting the minimum requirements of getting this cheaper pricing rate.
That』s where minimum ordering amounts generally come in and companies typically handle this with a minimum order quantity on the products.
In WooCommerce Wholesale Prices Premium this can be applied in two ways:
1. A minimum order quantity requirement (set in the global settings) which is applied to the order as a whole – the combination of all items in the cart for that order (total items ordered).

Minimum Order Requirements Global SettingsMinimum Order Requirements Global Settings (Click To Zoom)

2. Minimum product quantity & step restrictions applied via each individual product.

Wholesale Minimum Order Quantity & Wholesale Order Quantity Step Product SettingsWholesale Minimum Order Quantity & Wholesale Order Quantity Step Product Settings (Click To Zoom)

Wholesale customers can still order below the minimum quantity, however, wholesale price will not apply until they meet the minimum order requirements.
If you want to strictly implement the minimum order quantity for wholesale customers, you can set the product』s Wholesale Order Quantity Step to 1 to prevent ordering lower than the minimum in the Product page and enable the Role Specific Settings – Prevent purchase if wholesale condition is not met in the WooCommerce > Wholesale Roles settings to prevent them from checking out from cart.

Role Specific SettingRole Specific Setting (Click To Zoom)

Cart warning if minimum orders are not metCart warning if minimum orders are not met (Click To Zoom)

You can also use these in combination, however, both rules will then need to be satisfied:
Let』s illustrate with an example:

Global minimum order quantity restriction of 100
Product A with a minimum quantity of 20
Product B with no minimum quantity required

Fred is a wholesale customer and wants to make an order comprised of Product A and Product B.
He adds 10x Product A to his cart and 50x Product B to his cart.
Unfortunately, he doesn』t meet the minimum order restriction of 100 units, so this fails the test to see if he qualifies for wholesale pricing and he sees a notice on the cart to that effect.
Fred then increases his quantities to 120x Product B but he leaves 10x Product A.
The order now passes the first test but it fails the minimum quantity restriction of 20 for Product A and he sees a notice on the cart to that effect. Product B, however, WILL have wholesale pricing applied since the minimum quantity is 0 for that product and he has satisfied the global minimum order restriction of 100 units.
Fred now increases the quantity of Product A to 50x.
The order now passes both the global minimum order restriction of 100 units which enables wholesale pricing and now that he』s increased the quantity for Product A above 20 he also has satisfied that condition. Product B has already passed because there is no minimum required on that product.
He』s now super happy because he』s enjoying wholesale discounts on all of his order and the store owner is happy as well because he successfully boosted the value of the order making it more viable from a business perspective.

How To Apply Surcharge Fees Or Discounts Per Payment Gateway

How To Apply Surcharge Fees Or Discounts Per Payment Gateway

If you』re looking for an option to add a surcharge or a permanent discount for your wholesale customers for the usage of a particular payment gateway, we have a feature on our WooCommerce Wholesale Prices Premium extension that supports this so you can easily charge them or give a discount.
Simply go to our settings on WooCommerce > Settings > Wholesale Prices > Payment Gateway.
You should find the Wholesale Role/Payment Gateway Surcharge settings. Then select the wholesale role, which Payment Gateway this will be applied, add the Surcharge Title, set the Surcharge Type and enter the Surcharge Amount.
Please note that you can enter a negative amount to give discount instead of a surcharge.

If you want to override this setting per individual user, we also support per user Payment Gateway Surcharge/Discount.
Just go to your Users > All Users dashboard and edit the user you want to override their the surcharge/discount settings.
There, you』ll find the Override Payment Gateway Surcharge field and you have three options that you can select:

Use general wholesale role payment gateway surcharge
Do not use general wholesale role payment gateway surcharge
Specify payment gateway surcharge