/
/
Put a WooCommerce category on sale, every variation included
For store managers who want a percentage sale applied across a WooCommerce category by asking their AI assistant.
On this page
Connector
Connect WooCommerce, pick your AI tool and paste the prompt.
The problem
Category sales that miss variations or undercut discounts
Putting a WooCommerce category on sale means working out the sale price for every product and variation by hand, then editing each one. Miss a variation or overwrite a deeper discount and the promotion goes out wrong.
Without PopdockAI
- Open every product in the category
- Work out sale prices for each variation
- Edit them one by one
- Overwrite a deeper discount by mistake
With PopdockAI
- Sale prices are worked out for every published product and variation
- Items already on a deeper sale are skipped and listed
- You see every change before anything is written
- Only the sale price changes, and everything is read back
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** Put every published product in the category `{category}` on sale at `{discount-percent}`% off its regular price, including every variation of variable products.
**Step 1: Resolve the category**
Call `woocommerce-get-product-category` with `name.contains` = `{category}`. If more than one matches, list them with their `number-of-products` and stop so the user can pick. If none match, say so and stop.
**Step 2: Build the change list**
* `woocommerce-get-product` with `categories.contains` = the exact category name, `status` = `publish` and `max-records` 1000.
* For each `variable` product, `woocommerce-get-product-variation` with `product-id`.
For each simple product and each variation: new sale price = `regular-price` x (1 - `{discount-percent}` / 100), rounded to 2 decimals. Skip, and list separately with the reason:
* `grouped` and `external` products, and variable parents (their variations are changed instead).
* Items with no `regular-price`.
* Items whose current `sale-price` is already lower than the new one.
**Step 3: Confirm**
Show a table: name, SKU, product or variation, regular price, current sale price, new sale price. Then the skipped list and the total number of writes. Say that the sale has no end date through this tool, so it stays on until prices are changed again. Wait for an explicit yes. If there are more than 50 writes, confirm in batches of 50.
**Step 4: Apply**
* Simple products: `woocommerce-update-product` with `product-id` and `sale-price` only.
* Variations: `woocommerce-update-product-variation` with `variation-id` = `product-variation-id`, `product-id` and `sale-price` only.
Keep going if one write fails, and collect the failures.
**Step 5: Verify and report**
Re-read with `woocommerce-get-product` (`categories.contains`) and `woocommerce-get-product-variation` (`on-sale` true) and report: items changed, items skipped, failures with their error, and any item whose read-back `sale-price` does not match.
**Rules & Guidelines:**
* The only write tools this prompt may call are `woocommerce-update-product` and `woocommerce-update-product-variation`, once per item on the confirmed list.
* Do not call any other write tool (`woocommerce-add-order`, `woocommerce-update-order`, `woocommerce-add-order-note`, `woocommerce-send-order-details`, `woocommerce-add-refund`, `woocommerce-add-customer`, `woocommerce-update-customer`, `woocommerce-add-product`, `woocommerce-add-coupon`, `woocommerce-update-coupon`).
* Pass `sale-price` and the ids only. Never change `regular-price`, stock, status or names.
* Never add items that were not on the confirmed list.
**Validation:**
* `{discount-percent}` must be a number from 1 to 90. Otherwise ask again and stop.
* If the category has no published products, say so and stop.
* If the user's confirmation is anything other than a clear yes, stop without writing.Who it's for
One answer, three teams that use it
Ecommerce marketers
Launch a category promotion fast
Every product and variation gets its sale price in one confirmed step.
Put the Candles category on sale at 25 percent off in WooCommerce.
Store managers
Protect existing deeper discounts
Items already on a bigger sale are skipped and listed, so no price goes up by mistake.
Take 10 percent off everything in the Kitchen category, but leave deeper sales alone.
Merchandisers
Cover every variation
Each size and colour gets its own sale price from its regular price, so nothing is missed.
Put the Hoodies category on sale at 30 percent off, including all sizes and colours.
How it works
What PopdockAI does when you ask
You name the category and a percentage off, and your AI assistant works out every sale price. Nothing is written until you confirm, and regular prices are never touched.
01
Ask
You name the category and a percentage off.
02
Build
It works out a sale price for each published product and variation.
03
Confirm
You see every change and the skipped items, and say yes.
04
Apply
It sets only the sale price and reads everything back.
What PopdockAI provides
The tools behind the answer
Ready made tools for WooCommerce and one secure connection to your AI tool. No code, no exports.
woocommerce-get-product-category
woocommerce-get-product
woocommerce-get-product-variation
woocommerce-update-product
woocommerce-update-product-variation
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
Category sales that go live accurately
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
