Search

Variable Product

 

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, medium and small and in different colors.

Adding attributes for variations ↑ Back to Top

To add a variable product, either edit an existing product or create a new one.

  1. Go to: Products > Products.
  2. Select the Add Product button or edit an existing product.
  3. Once in a product, select Variable product from the Product Data dropdown.

Selecting variable product WooCommerce

4. In the Attributes section, add attributes before creating variations — use global attributes or define custom ones specific to each product.
• To use a global attribute, select it from the dropdown and then Add. Make sure to select the Select all button to add all of attributes to the variable product, and select the Used for variations checkbox to tell WooCommerce it’s for your variations:

Adding Global Attribute to Product WooCommerce

Adding Global Attributes to a Product

Setting Up Global Attributes

Setting Up Global Attributes

  • If adding new attributes, select Custom product attribute then Add.
Adding Custom Attributes to WooCommerce

Adding Custom Attributes to a Product

5. Name the attribute, e.g., Size.

6. Set values separated by a vertical pipe, e.g., small | medium | large.

7. Select the Used for variations checkbox to use in the Variations section.

8. Save attributes.

Setting Up Custom Attributes for Variations

Click the Save attributes button once you’ve created your custom attributes

Add variations ↑ Back to Top

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

Add Variation

Select attributes for your variation. To change additional data, click the triangle icon to expand the variation.

Any Color Any Size

Edit any of the available data. The only required field is Regular Price

Editing Many Variations

If you have more than 10 variations, use the buttons to navigate forward and backward through the list. Each time you navigate to a new set of variations, the previous set are saved. This ensures that all data is saved.

Variations Pagination

Setting Defaults

We recommend setting defaults you prefer on the variations. In the example, we have no defaults set, so users can pick any color and size right away from the product page.

Settings Defaults

If you want a certain variation already selected when a user visits the product page, you can set those. 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.

Variation Data

Each variation may be assigned:

  • 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 or leave blank to use the product’s SKU.
  • Enabled – Enable or disable the variation.
  • Downloadable – If this a downloadable variation.
  • Virtual – If this product isn’t physical or shipped, shipping settings are removed.
  • Manage Stock – Manage stock at the variation level.
  • Stock quantity – Stock for the specific variation, or left blank to use the product’s stock settings.
  • Regular Price (required) – Set the price for this variation.
  • Sale Price (optional) – Set a price for this variation when on sale.
  • Stock Qty – Shows if Manage Stock is selected. Input the quantity.
  • Allow Backorders – Choose how to handle backorders.
  • Stock Status – Set the status of your variation’s stock.
  • Weight – Weight for the variation, or left blank to use the product’s weight.
  • Dimensions – Height, width and length for the variation, or left blank to use the product’s dimensions.
  • Shipping class – Shipping class can affect shipping. Set this if it differs from the product.
  • Tax class – 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 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 before a download expires 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.

Add an image for the variation

  1. Expand the variation.
  2. Click the blue image placeholder (screenshot).
  3. Select the image you wish to use.
  4. Save.

Screen Shot on 2015-09-02 at 14-57-29

Duplicating a variable product ↑ Back to Top

To save time, you can make a copy of a product and its variations to create similar ones. More at: Duplicating a Product.

Bulk editing ↑ Back to Top

You can bulk-edit variations by selecting the specific piece of data you want from the dropdown. In this example, I want to edit prices for all variations.

Set Regular Prices

Linking possible variations ↑ Back to Top

You can select Create variations from all attributes to have WooCommerce create every possible combination of variations.

Create Variations From All Attributes

If your example had two 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 is presented with dropdown boxes to select variation options. Selecting options will reveal the stock, price and Add to Cart button for the variation, so the user can purchase.

In the product archive page, Add to Cart does not display because a variation must first be chosen before adding to cart on the product page.

variable product

FAQ ↑ Back to Top

Variations are not being added to the cart. Add to Cart button is missing.

This may be indirectly caused by the inability to read the jQuery Cookie js script. This happens because your host is using an outdated mod_security ruleset.

To determine if this is the cause, use your browser console (e.g., Firebug or Chrome Developer’s tool) and see if a JS error appears: “jQuery.cookie.min.js is not found.”

If yes, you have two options. Contact your hosting company to fix. Or use this cookie fix plugin: woocommerce-jquery-cookie-fix.zip

Back to the top