---
title: How to Add a Buy All Stock Button
description: Add a Buy all stock button so a WooCommerce customer can add every available unit in one click. Free.
url: "https://wpfactory.com/docs/woocommerce-buy-all-stock-button/"
updated: "2026-09-27"
category: How to
---

# How to Add a Buy All Stock Button

The Buy all stock button lets a customer add every available unit of a product to the cart in one click. It is handy for clearance and wholesale lots. This feature is free in the [Min Max Step Quantity Limits Manager for WooCommerce](https://wpfactory.com/item/product-quantity-for-woocommerce/) and works with products that have managed stock.

![Buy all stock button options in the General section](https://wpfactory.com/wp-content/uploads/woocommerce-buy-all-stock-button-1.png)

### Before you start

- The product must have **Manage stock** enabled (WooCommerce **Inventory** tab) with a stock quantity set.

### Steps

1. Go to **WPFactory > Quantity Manager** (also reachable at **WooCommerce > Settings > Product Quantity**).
2. Open the **General** section and find **Buy all stock button**.
3. Tick **Create a Buy all stock button on product page** (`wpfmmsq_buy_all_stock_button_enabled`).
4. Optionally set the **Button label**, **Button class**, **Alert message** and **Success message**.
5. Click **Save changes**.

### Options reference

| Label | Option ID | Default | Free/Pro |
| --- | --- | --- | --- |
| Buy all stock button (enable) | `wpfmmsq_buy_all_stock_button_enabled` | No | Free |
| Button label | `wpfmmsq_buy_all_stock_button_label` | Buy all stock | Free |
| Success message | `wpfmmsq_buy_all_stock_button_success_msg` | %qty% x %product_title% has been added to your cart. | Free |

**Note:** the button only works on products (or selected variations) with managed stock. On a variation without managed stock, the **Alert message** is shown instead. The **Success message** accepts `%qty%` and `%product_title%`.

### Get more control

This feature is free. [Min Max Step Quantity Limits Manager for WooCommerce](https://wpfactory.com/item/product-quantity-for-woocommerce/) Pro adds per-category and per-attribute quantity rules alongside it. Per-product minimum, maximum and step are free. [See what Pro unlocks](https://wpfactory.com/item/product-quantity-for-woocommerce/).

Related articles

- [How to Allow Selling Below the Minimum Quantity for Low Stock](https://wpfactory.com/docs/low-stock-sell-below/)
- [Stock Update Fails with Decimal Quantities](https://wpfactory.com/docs/decimal-stock-update-issue/)
- [Customers Can Still Add Multiple Quantities to the Cart](https://wpfactory.com/docs/multiple-quantity-allowed/)
- [How to Validate and Auto-Correct Cart Quantities](https://wpfactory.com/docs/woocommerce-validate-auto-correct-quantities/)
- [How to Show a Total Price by Quantity in WooCommerce](https://wpfactory.com/docs/woocommerce-total-price-by-quantity/)
