How to add a variable product (sizes and colours) in WooCommerce
When one product comes in several sizes or colours, you do not need a separate product for each one. A variable product lets the customer choose the size and colour on one page, and each combination (a variation) can have its own price, stock, SKU and photo. This guide shows you how to add a variable product in WooCommerce step by step, with an EgWeb T-shirt in sizes S to XL and three colours.
1) Choose Variable product
Go to Products → Add new product, write the product name (1) and description, then in the Product data box choose Variable product (2).
2) Add the first attribute (Size)
Open the Attributes tab (1). In Name (2) write Size, and in Value(s) (3) write the options separated by a vertical bar: S | M | L | XL. Make sure Used for variations (4) is ticked, then click Save attributes (5).
3) Add the second attribute (Color)
Click Add new (1), then fill the new attribute (2): Name Color, values Navy | White | Orange, with Used for variations ticked. Click Save attributes (3).
4) Generate the variations
Open the Variations tab (1) and click Generate variations (2), then confirm. WooCommerce creates one variation for every combination: 4 sizes × 3 colours = 12 variations.
5) Set the price for all variations at once
Open Bulk actions (1) and choose Set regular prices, type the price and confirm. All variations in the list (2) get the same price; you can then change the price of a single variation if it is different (for example XL).
6) Edit one variation
Click a variation to open it:
- Variation gallery: the photo shown when the customer chooses this colour.
- SKU: your code for this exact variation, for example
EGW-TS-S-NAVY. - Regular price (and Sale price for a discount).
- Tick Manage stock? to track the quantity of this variation…
- …and write the Stock quantity.
Click Save changes (1) under the variations list, then Publish (or Update) the product.
7) What the customer sees
On the product page the customer chooses the size and colour (1); WooCommerce shows the price, photo and stock of that variation (2), then they click Add to cart (3).
Common problems
- "This product is currently out of stock and unavailable" → the chosen variation has no price, or its stock is 0. Every variation needs a price.
- The Variations tab is empty → at least one attribute must have Used for variations ticked and be saved.
- The price shows a range (for example 300–350 EGP) → this is normal when variations have different prices.
- Too many variations → delete combinations you do not sell, or use Add manually instead of generating all of them.
Frequently asked questions
Can each colour have its own photo?
Yes, set the photo in each variation. Customers see it when they choose the colour.
Can I add many variable products from Excel?
Yes, with the CSV importer: How to add and edit WooCommerce products in bulk (CSV / Excel).
Does shipping change by size?
Only if you set a weight for each variation and use weight-based shipping. For prices by governorate see How to set shipping prices by governorate.







