/
/
Change WooCommerce stock and prices on exactly the right SKU
For store teams who want stock, regular price or sale price updated by SKU by asking their AI assistant.
On this page
Connector
Connect WooCommerce, pick your AI tool and paste the prompt.
The problem
Updating the wrong record behind a SKU
Changing stock or prices in WooCommerce by SKU means working out whether it is a simple product, a variation or a variable parent with no price of its own. Update the wrong record and the storefront shows the wrong price or stock.
Without PopdockAI
- Search the catalog for the SKU
- Work out whether it is a product or variation
- Edit stock and prices by hand
- Update the parent instead of the variation
With PopdockAI
- The item is found, listing variations if the SKU is a parent
- Stock and prices are validated
- It asks before turning on stock tracking
- The right record is updated once after you confirm and 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:** For the item with SKU `{sku}`, set the stock quantity to `{stock-quantity}`, the regular price to `{regular-price}` and the sale price to `{sale-price}`. Change only the values that are given.
**Step 1: Find the item**
1. Call `woocommerce-get-product` with `sku` = `{sku}`.
2. If nothing matches, call `woocommerce-get-product-variation` with `sku` = `{sku}`. A match is a variation: keep `product-variation-id` and its parent `product-id`.
3. If a product matches and its `type` is `variable`, the SKU belongs to the parent, which has no price of its own. Call `woocommerce-get-product-variation` with `product-id`, list the variations with their SKUs, and stop so the user can choose one.
4. If nothing matches either read, say so and stop.
Keep the current `regular-price`, `sale-price`, `stock-quantity` and `stock-status`.
**Step 2: Check the changes**
* If `{stock-quantity}`, `{regular-price}` and `{sale-price}` are all empty, ask what to change and stop.
* Stock must be a whole number of 0 or more. If the item's `stock-quantity` is currently empty, stock is not tracked: ask whether to turn tracking on, and only then pass `manage-stock` true.
* Prices must be numbers above 0. The sale price must be below the regular price that will apply after the change.
**Step 3: Confirm**
Show a before and after table for each value that changes, and say which tool will write. Wait for an explicit yes.
**Step 4: Update**
* A simple product: call `woocommerce-update-product` once with `product-id` and only the changed values.
* A variation: call `woocommerce-update-product-variation` once with `variation-id` = the `product-variation-id`, `product-id` = the parent id, and only the changed values.
**Step 5: Verify and report**
Re-read the item with the same read tool used in Step 1, filtered by `sku`, and report the values before and after, including `stock-status` (setting stock above 0 on a tracked item moves it back to `instock`).
**Rules & Guidelines:**
* The only write tools this prompt may call are `woocommerce-update-product` or `woocommerce-update-product-variation`, once, never both.
* 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`).
* Never pass `name`, `description`, `status` or `sku`; this prompt changes stock and prices only.
**Validation:**
* If the user's confirmation is anything other than a clear yes, stop without writing.
* If the update fails, report the error and stop.Who it's for
One answer, three teams that use it
Inventory managers
Set stock after a delivery
Update stock for a SKU in one message, on the exact variation that changed.
Set stock for TEE-BLK-L to 120 in WooCommerce.
Ecommerce managers
Put one item on sale
Set a sale price that is checked against the regular price before it goes live.
Put LAMP-110 on sale at 34.99 in WooCommerce.
Pricing managers
Change a regular price safely
Prices are validated above zero, and the record is read back after the update.
Change the regular price of KETTLE-05 to 49.00 in WooCommerce.
How it works
What PopdockAI does when you ask
You give a SKU and the new values, and your AI assistant finds the right record and checks them. You approve a before and after table, then only the changed values are written.
01
Ask
You give a SKU and any new stock, regular price or sale price.
02
Find
It finds the item, listing variations if the SKU is a variable parent.
03
Check
It validates stock and prices and asks before turning on stock tracking.
04
Confirm
You approve the before and after, then it updates once and reads 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
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
Changes on exactly the right product or variation
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)
