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 begin applying them a product.
To add a variation, go to the Variation section in the Product Data meta box.
Manually Adding a Variation
Select Add variation from the dropdown menu and click Go
Select attributes for your variation. To change additional data, click the triangle icon to expand the variation.
Edit any of the available data. The only required field is Regular Price
Editing Many Variations
If you have more than 10 variations, you must use the buttons to navigate forwards and backwards through the list of variations. Every time you navigate to a new set of variations the previous set are saved. This ensures that all data is saved.
We recommend setting defaults you prefer 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.
If you want a certain variation already selected when a user visits the product page, you can set those here. This also enables the Add to Cart button to appear automatically on variable product pages.
You can only set defaults after at least one variation has been created.
Each variation may be assigned the following data:
- An image – Select the placeholder icon to see the image uploader. After you choose an image, select Set Variation Image.
- SKU – If you use SKUs, set the SKU for the variation, or leave blank to use the variable product’s SKU.
- Enabled – Enable or disable the variation.
- Downloadable – If this a downloadable variation.
- Virtual – If this product isn’t shipped, shipping settings for the variation are removed.
- Manage Stock – Manage 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 for this variation. Required
- Sale Price – Set a price for this variation when 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 – Weight for the variation, or left blank to use the variable product’s weight.
- Dimensions – Height, width and length 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, dimensions and stock fields are not set, then it inherits values assigned to the variable product. Price fields must be set per variation.
Bulk editing ↑ Back to Top
You can bulk edit variations by selecting the specific piece of data you want from the dropdown. In this case I want to edit prices for all variations.
Linking possible variations ↑ Back to Top
If your example had 2 attributes – color (with values blue and green) and size (with values large and small), it creates 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.