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, it’s likely you have an old theme. You’ll need to use the WooCommerce Quantity Increment plugin to make it work.

Unfortunately, WooCommerce discontinued supporting this plugin via the WordPress.org repo on December 2018. So you’ll need to download the plugin file from their Github and upload it manually to your Plugins page, then activate.

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.

add_filter( 'wwof_filter_product_item_quantity', 'my_wwof_add_quantity_button', 99, 2 );
function str_replace_first($from, $to, $content) {
    $from = '/'.preg_quote($from, '/').'/';
    return preg_replace($from, $to, $content, 1);
}

function my_wwof_add_quantity_button( $quantity_field , $product ) {
   $quantity_field = str_replace('<div class="quantity">', '<div class="quantity buttons_added"><input type="button" value="-" class="minus">', $quantity_field);
   $quantity_field = str_replace_first('</div>', '<input type="button" value="+" class="plus"></div>', $quantity_field);

   // Return the result
   return $quantity_field;
}

Of course, the better solution is to use a theme that supports HTML5 properly and manipulates the styles of the HTML5 quantity input boxes directly.

in WooCommerce Wholesale Order Form

Solve The Big Three Problems With Wholesaling In WooCommerce

Add wholesale pricing to products   Streamline your ordering   Register & manage wholesale customer

Explore The Plugin Suite  

[data-image-id='gourmet_bg']
[data-image-id='gourmet_bg']
[data-image-id='gourmet_bg']
[data-image-id='gourmet_bg']
[data-image-id='gourmet_bg']
[data-image-id='gourmet_bg']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']
[data-image-id='gourmet']