How to add default quantities to WooCommerce Grouped Products and Product Bundles
You can create product bundles using the official WooCommerce Product Bundles plugin, or the ‘Grouped’ product type that comes with WooCommerce itself. Neither of these options comes with a facility to change the default quantity for each product within the group/bundle. You can achieve this by using either bundled or grouped products with the WooCommerce Default Quantity plugin.
The following screenshots show how grouped and bundled products behave when you use them alongside WooCommerce Default Quantity. The ‘Woo T-Shirt’ product has a default quantity of 0 and the ‘Blue T-Shirt’ product has a default quantity of 7.
- Screenshot 1 – This is what appears when the page first loads. The Blue T-Shirt doesn’t have a number after the title because the default quantity is zero. The Blue T-shirt has ‘x7’ after the name because the default quantity is 7.
- Screenshot 2 – This is what happens when you click to add each item to the bundle. You can see the default quantity in the Quantity box that appears. The customer can change the default quantity to any other number before clicking ‘Add to Cart’.
How to set it up
- Use the official documentation on WooCommerce.com to set up your grouped or bundled products in the usual way.
- Edit each individual product that you have selected to be in the group or bundle. This is NOT the parent product which you have set up as a grouped/bundled product – it is the normal simple or variable product which appears within the group/bundle.
- Use the WooCommerce Default Quantity plugin to choose your default product quantities. You can either set a default quantity globally, per category, or for each individual product.
Tip: If you want to show different default quantities for each product within the group/bundle, then you need to set a default quantity for the products that you have selected to be in the group or bundle. This is NOT the parent product which you have set up as a grouped/bundled product – it is the normal simple or variable product which appears within the group/bundle.
Using default quantities with min/max quantities in Product Bundles
If you usethe Product Bundles plugin to set a minimum or maximum quantity for a product and the customer tries to add the wrong number of items, then an error will appear when they click the Add to Cart button. The plugin does not prevent them from selecting the wrong quantity in the first place, but they will be preventing from adding an incorrect quantity to the cart.
To improve user experience, we recommend using EITHER a default quantity OR a minimum/maximum quantity for each product in the bundle, and not both. It’s fine to use default quantities for some products within a bundle and min/max quantities for others, but you should test the logic carefully if you wish to use both for a single product so that users are not disappointed if they try to add an incorrect quantity to the cart.