Variable Quantity is an extension of the Payment Button for PayPal WordPress plugin (also known as WP PayPal) that can be used to add a quantity field to your PayPal Buy buttons.
In order to add a quantity field you can use the following shortcode.
[wp_paypal button="buynow" name="My product" amount="1.00" quantity=""]
Leaving the quantity parameter empty implies that you wish to allow buyers to enter a quantity for this item.
When the button is rendered on the front end, a quantity box will appear with it.

Minimum Quantity
In order to restrict buyers to a minimum quantity, you can use the min_qty parameter in the shortcode.
[wp_paypal button="buynow" name="My product" amount="1.00" quantity="" min_qty="2"]
Maximum Quantity
In order to restrict buyers to a maximum quantity, you can use the max_qty parameter in the shortcode.
[wp_paypal button="buynow" name="My product" amount="1.00" quantity="" max_qty="5"]
Quantity Range
You can use both the min_qty and max_qty parameters to restrict the quantities of items that can be purchased.
[wp_paypal button="buynow" name="My product" amount="1.00" quantity="" min_qty="2" max_qty="5"]
Roland says
Amazing plugin. Keep it up.
Noor Alam says
@Roland, Thank you!
Keith Hammerbeck says
Is there a way to stipulate a minimum or maximum quantity?
Noor Alam says
@Keith, There is. You can use the “min_qty” and “max_qty” parameters in the shortcode.
Keith Hammerbeck says
Thank you. It isn’t working for me.
See in progress page at
https://grillhappy.com/wordpress/index.php/home/purchase/
The code for the “Two or more 3oz. bottles” entry is as follows:
[wp_paypal button="buynow" name="Grill Happy Seasoning - 3oz." amount="9.50" quantity="" min_qty="2" button_image="https://grillhappy.com/wordpress/wp-content/uploads/2022/02/BuyNowD.png" return="https://grillhappy.com/wordpress/index.php/thankyou" cancel_return="https://grillhappy.com/wordpress/index.php/cancell"]
I am able to enter quantity 1 and get it through to paypal as 1 @9.50.
Thank you,
Keith
Noor Alam says
@Keith, We have just sent you an email with an update. Let me know if you don’t receive it.