Manage product variations
Variations multiply everything: a product with three sizes and four colours has twelve of them, each with its own price and stock. That makes them the best case for delegating to an assistant and the easiest place to make twelve mistakes at once.
Requirements
Same as products: WooCommerce active, Allow WooCommerce catalog writes open, catalogue read and write scopes, shop management capability, and a backup.
The tools
| Tool | Does |
|---|---|
wc_get_product_variations |
List a product's variations |
wc_get_variation |
Read one |
wc_create_variation |
Create one |
wc_update_variation |
Update one |
wc_delete_variation |
Delete one |
wc_batch_update_variations |
Update several in one call |
Note that variations, unlike products, can be deleted through MCP. Deletion is not recoverable from the trash.
Attributes come first
Variations exist against a variable product's attributes. Before creating any:
- Confirm the product is variable —
wc_get_product. - Read its attributes —
wc_get_product_attributesandwc_get_attribute_terms. - Confirm the attributes are marked as used for variations.
An assistant creating variations against attributes the product does not have produces variations that never match a customer's selection. Reading first prevents it. See Manage the product catalog.
Read the existing set
List the variations for product 219 with their IDs, attributes, prices and stock, then stop.
For a product with many variations, this listing is the reference you will work against, and the record of the old values if something needs restoring.
The batch tool is powerful and blunt
wc_batch_update_variations updates several variations in one call. It is the right tool for "raise every variation's price by 5%" and the wrong tool for anything you have not verified on one variation first.
The safe sequence:
- Update one variation with
wc_update_variation, using a dry run. - Check the result on the storefront.
- Then batch the rest.
Use a dry run on variation 2204 first and show me the before and after.
A batch that applies the wrong rule to twelve variations is twelve manual corrections, and you will only have the old values if you listed them first.
Price and stock are separate concerns
Each variation carries its own regular price, sale price, stock status and stock quantity — and can inherit from the parent product for some of them.
Be explicit about which you are changing:
Update only the regular price on these variations. Do not change sale prices, stock quantities or stock status.
Stock in particular has a hidden dimension: changing stock status to "in stock" without a quantity, or setting a quantity while stock management is off, produces a storefront state that does not match what you intended.
Deleting variations
wc_delete_variation removes one permanently. Before deleting:
- confirm the variation is genuinely unused, not merely out of stock;
- check whether any customer link or feed points at it;
- prefer setting it out of stock or hidden if you are unsure.
Deleting a variation that a customer has in a cart or a wishlist produces an error for them, not for you.
After any variation change
- Read the variations back.
- Open the product page on the storefront.
- Select each changed variation in the product form and confirm the price and availability shown.
- Check that the price range displayed on listing pages updated.
- Purge the cache, then the CDN.
Step 3 is the one that matters. The stored data being right does not guarantee the customer-facing selector behaves correctly, particularly after attribute changes.
Common problems
| Symptom | Cause |
|---|---|
pom_ai_mcp_wc_variation_not_found |
Wrong ID, or the variation was deleted |
| Variations do not appear on the storefront | Attributes are not marked as used for variations |
| A variation cannot be selected | Its attribute combination does not match the product's attributes |
| The price range on listings is stale | Cache not purged |
| A batch applied the wrong rule | It was not piloted on one variation first |
| Stock shows incorrectly | Stock management settings versus the quantity written |