What Is the Show Custom Quantity Generator feature?
When customers use a WooCommerce Direct Checkout link (e.g., ?sku=ABC123), they typically land on the checkout page with the product pre-added at quantity 1. The Show Custom Quantity Generator feature adds a quantity input to the direct checkout page, so customers can adjust the quantity before completing checkout.
This is a sub-option of the Enable WooCommerce Direct Checkout Links master toggle.
Why You Need It
For B2B and bulk-order use cases, the default quantity 1 is rarely correct:
- Wholesale orders: Customers often need 10, 50, or 100 units
- Bulk promotions: “Buy 10 for $X” requires the customer to set quantity
- Custom orders: Some products are sold in configurable quantities
- Gifts and bundles: Customers may want to buy multiple of the same item
The Show Custom Quantity Generator feature provides a simple quantity input for these cases.
How to Show Custom Quantity Generator in WordPress
Step 1: Enable WooCommerce Direct Checkout Links
First, enable the master toggle. Go to WooCommerce > One Click Checkout and toggle on Enable WooCommerce Direct Checkout Links.
Step 2: Enable Show Custom Quantity Generator
In the same section, toggle on Show Custom Quantity Generator. The option appears below the master toggle.
Step 3: Save Changes
Click Save Changes.
Step 4: Test
Create a direct checkout link: https://yoursite.com/checkout/?sku=ABC123. Click the link. The checkout page should show a quantity input that lets you change the quantity before placing the order.
Configuration Options
| Option | Description | Default |
|---|---|---|
| Show Custom Quantity Generator | Master toggle. | Off |
The master toggle Enable WooCommerce Direct Checkout Links must also be on for this to take effect.
What Gets Affected
- The direct checkout page: a quantity input is shown
- The customer’s ability to set custom quantities before placing the order
- The cart: the custom quantity is added to the cart
What Does NOT Get Affected
- The standard checkout page (without the direct checkout link): the quantity input is NOT shown
- The product page: the standard quantity input is still used
- The cart page: the standard cart is still used
- The customer’s saved addresses or payment methods: not affected
Advanced Options (Developers)
This feature registers 1 WordPress hook in woocommerce-functions.php:
Actions:
wp_footercalls the quantity generator script injection (Injects quantity generator JS)
// Hooked in woocommerce-functions.php
// Quantity generator JS is injected via wp_footer
The feature modifies WooCommerce behavior by registering or removing hooks. Disabling it reverses those changes.
Troubleshooting
The quantity input is not showing
Cause: The toggle is off, or the master toggle (Enable WooCommerce Direct Checkout Links) is also off.
Fix: Verify both toggles are on. The quantity input only appears on the direct checkout page, not the standard checkout page.
The quantity input is showing but the cart doesn’t update
Cause: A theme or plugin conflict is preventing the quantity change from being captured.
Fix: Verify the form is submitting correctly. Check the browser console for errors. Disable other cart-related plugins to find the conflict.
The quantity input allows invalid values (e.g., negative numbers, decimals)
Cause: The default WooCommerce quantity input has built-in validation. Some custom inputs may not enforce this.
Fix: Configure in the plugin settings to add HTML5 validation (e.g., min="1", step="1").
The quantity input shows on all checkout pages, not just direct checkout
Cause: The hook is firing on all checkout pages, not just the direct checkout page.
Fix: Check the request parameters to verify the direct checkout link is being used. Configure in the plugin settings to restrict to direct checkout only.