Variable products are a product type in WooCommerce that lets you offer a set of variations on a product with control over prices, stock, image, and more for each variation. They can be used for a product like a shirt where you can offer a large t-shirt vs a small t-shirt.
Adding attributes for variations ↑ Back to Top
To add a variable product, either edit an existing product or create a new one by going to: Products > Products. You can select the Add Product button or edit an existing product from there. Once in a product select the Variable product from the Product Data dropdown.
In the attributes section, you’ll need to add attributes first before we can create variations – you can use global attributes or define custom ones specific to each product. To use a global attribute select it from the dropdown and then select Add. Make sure to select the Select all button to add all of the attribute to the variable product, and select the Used for variations checkbox to tell WooCommerce it’s for your variations:
If you are adding new attributes select Custom product attribute then select Add.
You’ll then need to name the attribute, for example Size. Set the values separated by a vertical pipe, in this instance small | medium | large. Finally select the Used for variations checkbox to use these in the Variations section. Select Save attributes!
Add variations ↑ Back to Top
After saving your variations, you can now begin setting them up on a product. To add a variation go to the Variation section in the Product Data meta box. First we’d recommend setting the defaults you’d like on the variations. In our example we don’t have any defaults set, so users can pick any color and size right away from the product page. But if you’d like a certain variation already selected when a user visits the product page, you can set those here.
You can select Link all variations to have WooCommerce create every possible combination of variations. You can also create these manually by selecting Add Variation. A new blank row will appear, ready for you to input data for that variation.
Each variation of a product may be assigned the following data:
- An image – select the placeholder the icon to see the image uploader. After you choose an image select insert into post.
- SKU – If you use SKUs, set the SKU for the variation, or leave blank to use the variable products SKU.
- Enabled - Enable or disable that variation.
- Downloadable - If this a downloadable variation.
- Virtual – If this product isn’t shipped, removes any shipping settings for the variation.
- Manage Stock - Use to manage the stock on the variation level.
- Stock quantity - Stock for the particular variation, or left blank to use the variable product’s stock settings.
- Regular Price – Set the price this variation sells for. Required
- Sale Price – Set a price for when the variation is on sale. Optional
- Stock Qty – Shows if Manage Stock is selected. Input the quantity you have.
- Allow Backorders – Choose how to handle backorders.
- Stock Status – Set the status of your variations stock.
- Weight - The weight for the variation, or left blank to use the variable product’s weight.
- Dimensions – The dimensions for the variation, or left blank to use the variable product’s dimensions.
- Shipping class – Shipping class can affect shipping. Set this if it differs from the variable product.
- Tax class – A tax class for this variation. Useful if you are offering variations spanning different tax bands.
- Downloadable Files – Shows if Downloadable is selected. Add file(s) for this variation for customers to download
- Download Limit – Shows if Downloadable is selected. Set how many times a customer can download the file(s). Leave blank for unlimited.
- Download Expiry – Shows if Downloadable is selected. Set the number of days for the download to expire after purchase.
If the sku, weight, dimension and stock fields are not set, then it simply inherits the values assigned to the variable product. Price fields must be set per variation.
Bulk editing ↑ Back to Top
Above the variations you have access to some bulk editing tools to speed up data input:
Linking possible variations ↑ Back to Top
If your example had 2 attributes – colour (with values blue and green) and size (with values large and small), it will create the following variations:
- Large Blue
- Large Green
- Small Blue
- Small Green
Frontend ↑ Back to Top
On the frontend, when viewing a variable product, the user will be presented with dropdown boxes to select the variation options; selecting options will reveal the stock, price and add to cart button for the variation so the user can purchase the product.