Connectors

/

WooCommerce

/

Put a WooCommerce category on sale
Write

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.

Try PopdockAI free
Get a live demo
Put a WooCommerce category on sale
Put the Mugs category in WooCommerce on sale at 20 percent off.
Mugs has 46 items to put on sale at 20 percent off. - Example: Blue mug, regular 12.00, sale 9.60 - Variations: 31 of the 46 are variations - Skipped: 3 already on a deeper sale, 1 with no regular price Shall I apply the 46 sale prices?
WooCommerce
Sample figures. Your results come from your own account.
woocommerce-get-product-category
woocommerce-get-product
woocommerce-get-product-variation
woocommerce-update-product
woocommerce-update-product-variation

On this page

The problem

The problem

The prompt

Who it's for

How it works

Tools used

Connector

WooCommerce

WooCommerce
Run it on your own WooCommerce data.

Connect WooCommerce, pick your AI tool and paste the prompt.

Try PopdockAI free

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.

Prompt
**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.

Your AI tool

02

Build

It works out a sale price for each published product and variation.

woocommerce-get-product-category
woocommerce-get-product
woocommerce-get-product-variation

03

Confirm

You see every change and the skipped items, and say yes.

No items found.

04

Apply

It sets only the sale price and reads everything back.

Your AI tool

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.

get-data

woocommerce-get-product-category

Returns WooCommerce product categories with their parent category and number of products. Filter by name, slug, id or parent category.
get-data

woocommerce-get-product

Returns WooCommerce products with prices, stock, status, categories, total sales and average rating. Filter by SKU, name, category, type, status, stock status, price range or a low stock threshold.
get-data

woocommerce-get-product-variation

Returns the variations of WooCommerce variable products with SKU, prices, sale flag and stock. Filter by parent product, SKU, status, stock status, price range, on sale or a low stock threshold.
run-action

woocommerce-update-product

Updates an existing WooCommerce product by id: name, description, SKU, prices, stock quantity, stock status and publishing status. For a variation use Update WooCommerce product variation.
run-action

woocommerce-update-product-variation

Updates one variation of a WooCommerce variable product by id: SKU, prices, stock quantity, stock status and publishing status.
Read only.Nothing in WooCommerce Changes

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.

How Popdock AI secures your data

The outcome

Category sales that go live accurately

Try PopdockAI free
Get a live demo

Related use cases

More ways to put this data to work

All Ramp use cases

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.

Try PopdockAI Free
See Documentation