How to Create WooCommerce Variations for Your Products
WooCommerce Explained is the best-selling book on WooCommerce.
In this exclusive tutorial, taken from WooCommerce Explained, we’re going to show you how to create variations for your WooCommerce products.
Variations allow users to choose different options for a product. This means you can sell a T-Shirt in different sizes and colors.
However, variations can be complex to set up. Before you read this blog, I highly recommend you read “How to create WooCommerce attributes“. Creating attributes is an essential first step before creating variations. The instructions in that post also follow on from that tutorial.
Your Video Guide to WooCommerce Variations
This video is courtesy of our friends at Nexcess. Experience the power of optimized cloud hosting! Use discount code “OSTraining” to get 50% off your first month of the Nexcess Cloud: https://ostra.in/nexcess-woo.
Creating WooCommerce Variations
Let’s start by creating a new product in our WooCommerce store.
- In your WordPress admin, hover over “Products” and click “New Product”.
- Enter “Plain Purple Shirt” as the title for this product.
- From the “Product Type” drop down, choose “Variable product”.
And let’s add our attributes.
- From the Product data meta box, click “Attributes”.
- Select “Styles” followed by “Add”.
- Select “Used for variations” and “Select all”.
- Click “Save attributes”.
- Click on the “Variations” tab.
- And from the drop down, select “Create variations from all attributes” followed by “Go”.
- You’ll see an alert pop up. Click “OK”.
You should now see your three WooCommerce variations, as shown in the image below.
You can click into each one and change specific things.
You can enter a price specific to this variation. You can choose a custom weight and dimensions – in the case of shirts, perhaps some sizes are physically larger than others. You can specifiy which variations are in stock.
In this example, let’s upload a custom photo for this WooCommerce variation. That will help the user make the right choice.
- Click the “Photo” icon and upload a t-shirt image.
- Repeat this for the U Neck and Polo variations.
- When you’re done, don’t forget to click “Save changes”.
- And then just for good measure, click “Update” (or “Publish” if the product wasn’t already published) just to make sure all of the data is saved.
Let’s take a look at this product on the front-end of your site.
When the user chooses a style, they’ll see updated pricing and an updated photo. If you see a message about the product being unavailable, you probably forgot to set a price for each variation.
Using variable products makes your store much easier to navigate for the end user. And you have less information to manage.
Setting up those attributes is a pain to do the first time. But once they’re set up, creating variable products isn’t too hard.
Attributes also display on the front end and make your product page a little easier to read for humans and search bots.
If you ever want to add custom information to the “Additional information” tab, you can manually type in attributes on the edit product page.
An example of another store doing this is Best Buy. If we look at one of their products, we can see a large amount of attributes. How far you want to go with attributes is entirely up to you. The more information that you provide for your customers, the more likely they are to buy because they feel safe and secure knowing everything about the product. So I recommend putting in as many attributes as you can.
If you enjoyed this introduction to WooCommerce Variations, check out WooCommerce Explained, the comprehensive introduction to WooCommerce.
Thank you! I have been so confused until I found this video!
Hi, do you know how to fix the problem of the alert pop up not prompting anymore when creating variable attributes. I created the attributes but the variations won’t create as the alert pop up that you need to press ok on is not appearing now?? Thanks!
Thank you for this in-depth tutorial. I am trying to work on prudct variations but not getting the actual results as I have already gone through several resources trying to implement the product variation process. Can you please describe me further how to do this? This is the code that I think is somehow wrong. Is there any other way to set product variations?
$variation_id = woo_insert_post( $variation_post );
$variation = new WooCommerce_Product_Variation( $variation_id );
foreach ($variation_data[‘attributes’] as $attribute => $term_name )
The problem that I am experiencing is adding an additional single Attribute / Variation onto a previously generated list. If I do so, all of the past data settings seems to disappear.
hey,
what id you have a choice of downloadable and physical product and also the physical product have color and size option
first should have the option of downloadable and physical product
if you choose physical product then there should be the option of choosing size and the color
only for the physical product
Hi Raj, Can you pls tell me from where i will get the choice of downloadable and physical product ? I am not getting this choice in my screen, that’s why i can not create item variations e.g Size/Colour/Style etc. Many thanks
Hi,
Do we need to add attribute in each product or there is any way to add at once for all products ?
I was in trouble while creating variation on my ecommerce website and now I learn it from the this blog. Thank you for sharing the article.