claude-plugin-wordpress-manager 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +5 -3
- package/CHANGELOG.md +33 -0
- package/agents/wp-ecommerce-manager.md +136 -0
- package/agents/wp-site-manager.md +1 -0
- package/docs/GUIDE.md +306 -33
- package/docs/plans/2026-02-28-roadmap-v1.8-v2.1-design.md +314 -0
- package/docs/plans/2026-02-28-woocommerce-v1.8.0.md +2012 -0
- package/package.json +6 -3
- package/servers/wp-rest-bridge/build/tools/index.d.ts +927 -0
- package/servers/wp-rest-bridge/build/tools/index.js +20 -2
- package/servers/wp-rest-bridge/build/tools/wc-coupons.d.ts +144 -0
- package/servers/wp-rest-bridge/build/tools/wc-coupons.js +92 -0
- package/servers/wp-rest-bridge/build/tools/wc-customers.d.ts +141 -0
- package/servers/wp-rest-bridge/build/tools/wc-customers.js +92 -0
- package/servers/wp-rest-bridge/build/tools/wc-orders.d.ts +186 -0
- package/servers/wp-rest-bridge/build/tools/wc-orders.js +128 -0
- package/servers/wp-rest-bridge/build/tools/wc-products.d.ts +324 -0
- package/servers/wp-rest-bridge/build/tools/wc-products.js +177 -0
- package/servers/wp-rest-bridge/build/tools/wc-reports.d.ts +117 -0
- package/servers/wp-rest-bridge/build/tools/wc-reports.js +94 -0
- package/servers/wp-rest-bridge/build/tools/wc-settings.d.ts +72 -0
- package/servers/wp-rest-bridge/build/tools/wc-settings.js +70 -0
- package/servers/wp-rest-bridge/build/types.d.ts +85 -0
- package/servers/wp-rest-bridge/build/wordpress.d.ts +9 -0
- package/servers/wp-rest-bridge/build/wordpress.js +75 -0
- package/skills/wordpress-router/references/decision-tree.md +3 -1
- package/skills/wp-audit/SKILL.md +1 -0
- package/skills/wp-backup/SKILL.md +1 -0
- package/skills/wp-deploy/SKILL.md +1 -0
- package/skills/wp-woocommerce/SKILL.md +110 -0
- package/skills/wp-woocommerce/references/analytics-reports.md +75 -0
- package/skills/wp-woocommerce/references/coupon-marketing.md +92 -0
- package/skills/wp-woocommerce/references/order-workflow.md +88 -0
- package/skills/wp-woocommerce/references/payment-gateways.md +69 -0
- package/skills/wp-woocommerce/references/product-management.md +61 -0
- package/skills/wp-woocommerce/references/shipping-setup.md +79 -0
- package/skills/wp-woocommerce/references/tax-configuration.md +91 -0
- package/skills/wp-woocommerce/references/wc-extensions.md +97 -0
- package/skills/wp-woocommerce/scripts/woocommerce_inspect.mjs +181 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-woocommerce
|
|
3
|
+
description: |
|
|
4
|
+
This skill should be used when the user asks to "manage products", "check orders",
|
|
5
|
+
"create a coupon", "view sales report", "WooCommerce setup", "configure shipping",
|
|
6
|
+
"manage WooCommerce store", "product catalog", "inventory management",
|
|
7
|
+
"order fulfillment", or any WooCommerce e-commerce operations.
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Comprehensive WooCommerce store management via the WP REST Bridge WC tools (30 MCP tools using the `wc/v3` namespace). Covers product catalog CRUD, order lifecycle, customer management, coupon marketing, sales analytics, and store configuration (payments, shipping, taxes).
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- User mentions WooCommerce, products, orders, coupons, or store management
|
|
18
|
+
- User needs sales reports, revenue analytics, or top-selling products
|
|
19
|
+
- User wants to configure payment gateways, shipping zones, or tax classes
|
|
20
|
+
- User needs to manage WooCommerce customers or process refunds
|
|
21
|
+
- User asks about WooCommerce extensions or system status
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
WooCommerce credentials must be configured in `WP_SITES_CONFIG`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"id": "myshop",
|
|
30
|
+
"url": "https://myshop.com",
|
|
31
|
+
"username": "admin",
|
|
32
|
+
"password": "xxxx xxxx xxxx xxxx",
|
|
33
|
+
"wc_consumer_key": "ck_xxxx",
|
|
34
|
+
"wc_consumer_secret": "cs_xxxx"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Generate Consumer Key/Secret in WooCommerce > Settings > Advanced > REST API.
|
|
39
|
+
|
|
40
|
+
## Detection
|
|
41
|
+
|
|
42
|
+
Run the detection script to check WooCommerce presence:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
node skills/wp-woocommerce/scripts/woocommerce_inspect.mjs
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## WooCommerce Operations Decision Tree
|
|
49
|
+
|
|
50
|
+
1. **Product management?**
|
|
51
|
+
- List/search products → `wc_list_products`
|
|
52
|
+
- Create product → `wc_create_product`
|
|
53
|
+
- Update product → `wc_update_product`
|
|
54
|
+
- Delete product → `wc_delete_product`
|
|
55
|
+
- Categories → `wc_list_product_categories`
|
|
56
|
+
- Variations → `wc_list_product_variations`
|
|
57
|
+
|
|
58
|
+
2. **Order management?**
|
|
59
|
+
- List/filter orders → `wc_list_orders`
|
|
60
|
+
- Order details → `wc_get_order`
|
|
61
|
+
- Update status → `wc_update_order_status`
|
|
62
|
+
- Add note → `wc_create_order_note`
|
|
63
|
+
- Process refund → `wc_create_refund`
|
|
64
|
+
|
|
65
|
+
3. **Customer management?**
|
|
66
|
+
- List/search customers → `wc_list_customers`
|
|
67
|
+
- Customer details → `wc_get_customer`
|
|
68
|
+
- Create customer → `wc_create_customer`
|
|
69
|
+
- Update customer → `wc_update_customer`
|
|
70
|
+
|
|
71
|
+
4. **Marketing/Coupons?**
|
|
72
|
+
- List coupons → `wc_list_coupons`
|
|
73
|
+
- Create coupon → `wc_create_coupon`
|
|
74
|
+
- Delete coupon → `wc_delete_coupon`
|
|
75
|
+
|
|
76
|
+
5. **Analytics/Reports?**
|
|
77
|
+
- Sales summary → `wc_get_sales_report`
|
|
78
|
+
- Top products → `wc_get_top_sellers`
|
|
79
|
+
- Order totals → `wc_get_orders_totals`
|
|
80
|
+
- Product totals → `wc_get_products_totals`
|
|
81
|
+
- Customer totals → `wc_get_customers_totals`
|
|
82
|
+
|
|
83
|
+
6. **Store configuration?**
|
|
84
|
+
- Payment gateways → `wc_list_payment_gateways`
|
|
85
|
+
- Shipping zones → `wc_list_shipping_zones`
|
|
86
|
+
- Tax classes → `wc_get_tax_classes`
|
|
87
|
+
- System status → `wc_get_system_status`
|
|
88
|
+
|
|
89
|
+
## Recommended Agent
|
|
90
|
+
|
|
91
|
+
For complex multi-step WooCommerce operations, use the `wp-ecommerce-manager` agent.
|
|
92
|
+
|
|
93
|
+
## Additional Resources
|
|
94
|
+
|
|
95
|
+
### Reference Files
|
|
96
|
+
|
|
97
|
+
- **`references/product-management.md`** — CRUD products, variations, bulk operations, image management
|
|
98
|
+
- **`references/order-workflow.md`** — Order lifecycle, status transitions, notes, refunds
|
|
99
|
+
- **`references/analytics-reports.md`** — Sales reports, KPIs, date ranges, export strategies
|
|
100
|
+
- **`references/coupon-marketing.md`** — Coupon strategies, discount types, usage limits
|
|
101
|
+
- **`references/shipping-setup.md`** — Shipping zones, methods, classes, flat rate/free shipping
|
|
102
|
+
- **`references/payment-gateways.md`** — Gateway configuration, test mode, supported providers
|
|
103
|
+
- **`references/tax-configuration.md`** — Tax classes, rates by country, automated tax services
|
|
104
|
+
- **`references/wc-extensions.md`** — Popular extensions, compatibility, WC Marketplace
|
|
105
|
+
|
|
106
|
+
### Related Skills
|
|
107
|
+
|
|
108
|
+
- `wp-deploy` — Deploy WooCommerce store changes to production
|
|
109
|
+
- `wp-audit` — Audit WooCommerce store security and performance
|
|
110
|
+
- `wp-backup` — Backup WooCommerce database and uploads
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Analytics and Reports
|
|
2
|
+
|
|
3
|
+
WooCommerce provides built-in reporting endpoints for sales performance, product popularity, and store-wide totals. Reports support predefined periods and custom date ranges, enabling both quick snapshots and historical trend analysis.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_get_sales_report` | Sales totals: revenue, orders, items, tax, shipping, discounts |
|
|
10
|
+
| `wc_get_top_sellers` | Top-selling products ranked by quantity sold |
|
|
11
|
+
| `wc_get_orders_totals` | Order counts grouped by status |
|
|
12
|
+
| `wc_get_products_totals` | Product counts grouped by type |
|
|
13
|
+
| `wc_get_customers_totals` | Customer counts (total, paying, returning) |
|
|
14
|
+
|
|
15
|
+
## Sales Report Fields
|
|
16
|
+
|
|
17
|
+
`wc_get_sales_report` returns:
|
|
18
|
+
|
|
19
|
+
| Field | Description |
|
|
20
|
+
|-------|-------------|
|
|
21
|
+
| `total_sales` | Gross revenue including tax and shipping |
|
|
22
|
+
| `net_sales` | Revenue after discounts, before tax |
|
|
23
|
+
| `average_sales` | Average daily sales for the period |
|
|
24
|
+
| `total_orders` | Number of orders placed |
|
|
25
|
+
| `total_items` | Total items sold |
|
|
26
|
+
| `total_tax` | Total tax collected |
|
|
27
|
+
| `total_shipping` | Total shipping charged |
|
|
28
|
+
| `total_discount` | Total discounts applied |
|
|
29
|
+
| `total_customers` | Unique customers in period |
|
|
30
|
+
|
|
31
|
+
## Period Options
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
// Predefined periods
|
|
35
|
+
{ "period": "week" } // Last 7 days
|
|
36
|
+
{ "period": "month" } // Current calendar month
|
|
37
|
+
{ "period": "last_month" } // Previous calendar month
|
|
38
|
+
{ "period": "year" } // Current calendar year
|
|
39
|
+
|
|
40
|
+
// Custom date range
|
|
41
|
+
{ "date_min": "2026-01-01", "date_max": "2026-01-31" }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Common Report Procedures
|
|
45
|
+
|
|
46
|
+
### Monthly Sales Summary
|
|
47
|
+
|
|
48
|
+
1. `wc_get_sales_report` with `period: "month"`
|
|
49
|
+
2. `wc_get_top_sellers` with `period: "month"` — limit 10
|
|
50
|
+
3. `wc_get_orders_totals` — check processing vs completed ratio
|
|
51
|
+
4. Calculate KPIs from returned data
|
|
52
|
+
|
|
53
|
+
### Year-over-Year Comparison
|
|
54
|
+
|
|
55
|
+
1. `wc_get_sales_report` with `date_min: "2026-01-01"`, `date_max: "2026-12-31"`
|
|
56
|
+
2. `wc_get_sales_report` with `date_min: "2025-01-01"`, `date_max: "2025-12-31"`
|
|
57
|
+
3. Compare `total_sales`, `total_orders`, `total_customers`
|
|
58
|
+
|
|
59
|
+
## KPI Formulas
|
|
60
|
+
|
|
61
|
+
| KPI | Formula |
|
|
62
|
+
|-----|---------|
|
|
63
|
+
| Average Order Value (AOV) | `net_sales / total_orders` |
|
|
64
|
+
| Revenue per Customer | `net_sales / total_customers` |
|
|
65
|
+
| Items per Order | `total_items / total_orders` |
|
|
66
|
+
| Discount Rate | `total_discount / total_sales * 100` |
|
|
67
|
+
| Tax Rate | `total_tax / net_sales * 100` |
|
|
68
|
+
|
|
69
|
+
## Tips and Gotchas
|
|
70
|
+
|
|
71
|
+
- **Report data lag**: WooCommerce reports reflect order data at time of query; very recent orders may not appear immediately in aggregated totals.
|
|
72
|
+
- **Status filter**: By default, reports include `completed` and `processing` orders. Cancelled/refunded orders are excluded from sales totals.
|
|
73
|
+
- **Top sellers by quantity**: `wc_get_top_sellers` ranks by units sold, not revenue. Cross-reference with product prices for revenue ranking.
|
|
74
|
+
- **Custom ranges**: When using `date_min`/`date_max`, the format must be `YYYY-MM-DD` — no time component.
|
|
75
|
+
- **Export**: WooCommerce REST API does not provide CSV export; format results as markdown tables or pipe to a file for client-facing reports.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Coupon and Marketing
|
|
2
|
+
|
|
3
|
+
WooCommerce coupons enable flexible discount strategies: percentage off, fixed cart discounts, and fixed product discounts. Coupons support usage limits, product/category restrictions, and customer-specific targeting for targeted marketing campaigns.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_list_coupons` | List all coupons with current usage counts |
|
|
10
|
+
| `wc_get_coupon` | Get full coupon details including restrictions |
|
|
11
|
+
| `wc_create_coupon` | Create a new coupon with discount rules |
|
|
12
|
+
| `wc_delete_coupon` | Delete a coupon permanently |
|
|
13
|
+
|
|
14
|
+
## Discount Types
|
|
15
|
+
|
|
16
|
+
| Type | Effect |
|
|
17
|
+
|------|--------|
|
|
18
|
+
| `percent` | Percentage off cart total (e.g., 20% off) |
|
|
19
|
+
| `fixed_cart` | Fixed amount off the cart (e.g., $10 off) |
|
|
20
|
+
| `fixed_product` | Fixed amount off each qualifying product |
|
|
21
|
+
|
|
22
|
+
## Coupon Configuration Fields
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"code": "WELCOME20",
|
|
27
|
+
"discount_type": "percent",
|
|
28
|
+
"amount": "20",
|
|
29
|
+
"individual_use": true,
|
|
30
|
+
"usage_limit": 1,
|
|
31
|
+
"usage_limit_per_user": 1,
|
|
32
|
+
"minimum_amount": "50.00",
|
|
33
|
+
"maximum_amount": "500.00",
|
|
34
|
+
"product_ids": [],
|
|
35
|
+
"excluded_product_ids": [],
|
|
36
|
+
"product_categories": [],
|
|
37
|
+
"excluded_product_categories": [],
|
|
38
|
+
"email_restrictions": ["customer@example.com"],
|
|
39
|
+
"date_expires": "2026-12-31T23:59:59"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Marketing Strategies
|
|
44
|
+
|
|
45
|
+
### Welcome Discount
|
|
46
|
+
|
|
47
|
+
New subscriber or first-purchase incentive:
|
|
48
|
+
- `discount_type: "percent"`, `amount: "15"`, `usage_limit_per_user: 1`
|
|
49
|
+
- Set `individual_use: true` to prevent stacking
|
|
50
|
+
|
|
51
|
+
### Cart Abandonment Recovery
|
|
52
|
+
|
|
53
|
+
Sent via email automation to customers with abandoned carts:
|
|
54
|
+
- `discount_type: "fixed_cart"`, short expiry (`date_expires`: 48–72 hours out)
|
|
55
|
+
- Single-use per customer: `usage_limit_per_user: 1`
|
|
56
|
+
|
|
57
|
+
### Seasonal/Flash Sale
|
|
58
|
+
|
|
59
|
+
Time-limited broad discount:
|
|
60
|
+
- Set `date_expires` to end of sale period
|
|
61
|
+
- Use `minimum_amount` to encourage larger baskets
|
|
62
|
+
- No product restrictions for storewide sales
|
|
63
|
+
|
|
64
|
+
### Loyalty/VIP Reward
|
|
65
|
+
|
|
66
|
+
Exclusive codes for returning customers:
|
|
67
|
+
- `email_restrictions`: list specific customer emails
|
|
68
|
+
- `discount_type: "percent"`, higher value (e.g., 25%)
|
|
69
|
+
- `individual_use: true`
|
|
70
|
+
|
|
71
|
+
## Common Procedures
|
|
72
|
+
|
|
73
|
+
### Create and Verify Coupon
|
|
74
|
+
|
|
75
|
+
1. `wc_create_coupon` with full configuration
|
|
76
|
+
2. `wc_get_coupon` with returned ID to confirm all fields saved correctly
|
|
77
|
+
3. Note the `usage_count` field — starts at 0
|
|
78
|
+
|
|
79
|
+
### Audit Active Coupons
|
|
80
|
+
|
|
81
|
+
1. `wc_list_coupons` with `per_page: 100`
|
|
82
|
+
2. Check `usage_count` vs `usage_limit` for each
|
|
83
|
+
3. Check `date_expires` to identify expired coupons
|
|
84
|
+
4. `wc_delete_coupon` for expired or exhausted coupons
|
|
85
|
+
|
|
86
|
+
## Tips and Gotchas
|
|
87
|
+
|
|
88
|
+
- **Code case**: WooCommerce stores coupon codes in lowercase. `WELCOME20` and `welcome20` are the same code.
|
|
89
|
+
- **Individual use**: `individual_use: true` prevents the coupon from being combined with other coupons in the same cart.
|
|
90
|
+
- **Free shipping**: Set `free_shipping: true` on a coupon to grant free shipping regardless of zone settings — no need to configure a separate free shipping method.
|
|
91
|
+
- **Usage limit vs per-user**: `usage_limit` is the total times the coupon can be used across all customers; `usage_limit_per_user` limits per individual customer account.
|
|
92
|
+
- **Deletion is permanent**: `wc_delete_coupon` does not move to trash. Prefer expiring coupons by setting `date_expires` rather than deleting for audit trail purposes.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Order Workflow
|
|
2
|
+
|
|
3
|
+
WooCommerce orders follow a defined lifecycle from initial placement through fulfillment or cancellation. Understanding valid status transitions, order notes, and refund processes is essential for efficient store operations.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_list_orders` | List/filter orders by status, date, customer, or product |
|
|
10
|
+
| `wc_get_order` | Get full order details including line items, billing, shipping |
|
|
11
|
+
| `wc_update_order_status` | Transition order to a new status |
|
|
12
|
+
| `wc_list_order_notes` | List all notes (internal and customer-visible) on an order |
|
|
13
|
+
| `wc_create_order_note` | Add a note to an order |
|
|
14
|
+
| `wc_create_refund` | Create a partial or full refund for an order |
|
|
15
|
+
|
|
16
|
+
## Order Status Lifecycle
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
pending → processing → completed
|
|
20
|
+
↓ ↓
|
|
21
|
+
cancelled on-hold
|
|
22
|
+
↓
|
|
23
|
+
refunded
|
|
24
|
+
↓
|
|
25
|
+
failed
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Status | Meaning |
|
|
29
|
+
|--------|---------|
|
|
30
|
+
| `pending` | Payment not yet received |
|
|
31
|
+
| `processing` | Payment received, awaiting fulfillment |
|
|
32
|
+
| `on-hold` | Awaiting payment confirmation (bank transfer) |
|
|
33
|
+
| `completed` | Order fulfilled and shipped |
|
|
34
|
+
| `cancelled` | Cancelled by customer or admin |
|
|
35
|
+
| `refunded` | Fully refunded |
|
|
36
|
+
| `failed` | Payment failed or declined |
|
|
37
|
+
|
|
38
|
+
## Valid Status Transitions
|
|
39
|
+
|
|
40
|
+
- `pending` → `processing`, `on-hold`, `cancelled`, `failed`
|
|
41
|
+
- `processing` → `completed`, `on-hold`, `cancelled`, `refunded`
|
|
42
|
+
- `on-hold` → `processing`, `cancelled`
|
|
43
|
+
- `completed` → `refunded` (via `wc_create_refund`)
|
|
44
|
+
- Any status → `cancelled` (with care — triggers stock restore)
|
|
45
|
+
|
|
46
|
+
## Filtering Orders
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
// Recent processing orders
|
|
50
|
+
{ "status": "processing", "per_page": 50, "orderby": "date", "order": "desc" }
|
|
51
|
+
|
|
52
|
+
// Orders by date range
|
|
53
|
+
{ "after": "2026-01-01T00:00:00", "before": "2026-01-31T23:59:59" }
|
|
54
|
+
|
|
55
|
+
// Orders for specific customer
|
|
56
|
+
{ "customer": 42 }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Order Notes
|
|
60
|
+
|
|
61
|
+
Two types of notes via `wc_create_order_note`:
|
|
62
|
+
|
|
63
|
+
- **Customer-visible** (`customer_note: true`): Sent to customer by email; use for shipping updates and tracking numbers.
|
|
64
|
+
- **Internal** (`customer_note: false`): Only visible in WP admin; use for staff notes and pick/pack instructions.
|
|
65
|
+
|
|
66
|
+
## Refund Process
|
|
67
|
+
|
|
68
|
+
1. Get order details: `wc_get_order` — verify items, amounts, payment method
|
|
69
|
+
2. Confirm with user: total to refund, which line items, whether to restock
|
|
70
|
+
3. Create refund: `wc_create_refund` with `amount`, `reason`, and optionally `line_items` for partial refunds
|
|
71
|
+
4. Verify: status transitions to `refunded` (full) or stays `processing` (partial)
|
|
72
|
+
|
|
73
|
+
Partial refund example:
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"amount": "15.00",
|
|
77
|
+
"reason": "Damaged item — partial refund",
|
|
78
|
+
"restock_items": true
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Tips and Gotchas
|
|
83
|
+
|
|
84
|
+
- **Restock on cancel**: WooCommerce automatically restocks items when an order is cancelled if stock management is enabled.
|
|
85
|
+
- **Payment gateway refunds**: `wc_create_refund` triggers automatic refund via the payment gateway only if the gateway supports it (Stripe does, PayPal Standard does not).
|
|
86
|
+
- **Cannot un-complete**: Moving from `completed` back to `processing` is not a standard WooCommerce transition — avoid this.
|
|
87
|
+
- **Bulk status updates**: Iterate over order IDs with `wc_update_order_status`; there is no bulk endpoint in `wc/v3`.
|
|
88
|
+
- **Note emails**: Customer-visible notes trigger an email notification to the customer — use sparingly and with care.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Payment Gateways
|
|
2
|
+
|
|
3
|
+
WooCommerce supports multiple payment gateways, each configurable for test and live modes. The REST API provides visibility into active gateways, their status, and settings — essential for store health checks and go-live verification.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_list_payment_gateways` | List all installed gateways with enabled status and settings |
|
|
10
|
+
|
|
11
|
+
Note: Enabling/disabling gateways and updating API keys requires WooCommerce admin UI. Use `wc_list_payment_gateways` to audit current configuration.
|
|
12
|
+
|
|
13
|
+
## Built-in Payment Gateways
|
|
14
|
+
|
|
15
|
+
| Gateway | ID | Notes |
|
|
16
|
+
|---------|----|-------|
|
|
17
|
+
| Direct Bank Transfer | `bacs` | Manual payment; admin must confirm receipt |
|
|
18
|
+
| Check Payments | `cheque` | Manual; slow reconciliation |
|
|
19
|
+
| Cash on Delivery | `cod` | Offline payment at delivery |
|
|
20
|
+
| PayPal Standard | `paypal` | Redirect to PayPal; no SCA/3DS |
|
|
21
|
+
| PayPal Payments | `ppcp-gateway` | Modern PayPal with card fields |
|
|
22
|
+
|
|
23
|
+
## Popular Extension Gateways
|
|
24
|
+
|
|
25
|
+
| Gateway | Notes |
|
|
26
|
+
|---------|-------|
|
|
27
|
+
| Stripe | Cards, Apple/Google Pay, SEPA, iDEAL |
|
|
28
|
+
| Square | In-person + online; syncs inventory |
|
|
29
|
+
| Mollie | European-focused; iDEAL, Bancontact, Klarna |
|
|
30
|
+
| Authorize.Net | US-focused; recurring billing |
|
|
31
|
+
| Braintree | PayPal-owned; strong subscription support |
|
|
32
|
+
|
|
33
|
+
## Gateway Configuration Fields
|
|
34
|
+
|
|
35
|
+
`wc_list_payment_gateways` returns per gateway:
|
|
36
|
+
|
|
37
|
+
| Field | Meaning |
|
|
38
|
+
|-------|---------|
|
|
39
|
+
| `enabled` | Whether the gateway is active for checkout |
|
|
40
|
+
| `title` | Customer-facing name at checkout |
|
|
41
|
+
| `description` | Customer-facing description |
|
|
42
|
+
| `settings.testmode` | `yes` = sandbox mode active |
|
|
43
|
+
| `settings.api_key` | Public API key (never log secret keys) |
|
|
44
|
+
|
|
45
|
+
## Test Mode Workflow
|
|
46
|
+
|
|
47
|
+
1. `wc_list_payment_gateways` — identify the target gateway, note current `testmode` value
|
|
48
|
+
2. In WooCommerce admin: enable test mode, enter sandbox credentials
|
|
49
|
+
3. Place test orders using gateway's sandbox card numbers
|
|
50
|
+
4. Verify order status transitions correctly (pending → processing → completed)
|
|
51
|
+
5. In WooCommerce admin: disable test mode, enter live credentials
|
|
52
|
+
6. `wc_list_payment_gateways` — confirm `testmode.value` is `"no"` and `enabled` is `true`
|
|
53
|
+
|
|
54
|
+
## Go-Live Checklist
|
|
55
|
+
|
|
56
|
+
- `wc_list_payment_gateways` — verify only intended gateways are enabled
|
|
57
|
+
- Confirm `testmode` is `"no"` on all live gateways
|
|
58
|
+
- Confirm SSL is active (`wc_get_system_status` — check `environment.https`)
|
|
59
|
+
- Place a real low-value test transaction and refund it
|
|
60
|
+
- Confirm webhook URLs are registered in gateway dashboard (Stripe, PayPal)
|
|
61
|
+
|
|
62
|
+
## Tips and Gotchas
|
|
63
|
+
|
|
64
|
+
- **Never log secret keys**: `wc_list_payment_gateways` may return API settings — filter or redact secret/private keys from any output shared with users.
|
|
65
|
+
- **Test mode and live orders**: If test mode is accidentally left enabled, real customers receive payment errors or test confirmations. Always verify before go-live.
|
|
66
|
+
- **Gateway conflicts**: Some gateways conflict with others (e.g., two Stripe plugins). `wc_get_system_status` active plugin list helps diagnose this.
|
|
67
|
+
- **SCA/3DS compliance**: PayPal Standard does not support Strong Customer Authentication. For EU stores, use PayPal Payments (ppcp-gateway) or Stripe.
|
|
68
|
+
- **COD and digital products**: Cash on Delivery should typically be disabled for downloadable/virtual products. Configure gateway availability in WooCommerce admin.
|
|
69
|
+
- **Currency**: Each gateway supports specific currencies. `wc_list_payment_gateways` settings may include `supported_currencies` — verify store currency compatibility.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Product Management
|
|
2
|
+
|
|
3
|
+
WooCommerce product management covers the full lifecycle of items in your store catalog: creation, pricing, inventory, categorization, and publishing. Products can be simple, variable, grouped, or external/affiliate types, each with distinct configuration requirements.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_list_products` | List/search products with filters (status, category, stock, SKU) |
|
|
10
|
+
| `wc_get_product` | Get full details for a single product by ID |
|
|
11
|
+
| `wc_create_product` | Create a new product (simple or variable parent) |
|
|
12
|
+
| `wc_update_product` | Update pricing, stock, status, description, categories |
|
|
13
|
+
| `wc_delete_product` | Permanently delete a product (irreversible) |
|
|
14
|
+
| `wc_list_product_categories` | List all product categories with hierarchy |
|
|
15
|
+
| `wc_list_product_variations` | List variations of a variable product |
|
|
16
|
+
|
|
17
|
+
## Product Types
|
|
18
|
+
|
|
19
|
+
- **Simple** — Single SKU, one price, no variations
|
|
20
|
+
- **Variable** — Multiple variations (size, color) each with own SKU and price
|
|
21
|
+
- **Grouped** — Collection of related simple products displayed together
|
|
22
|
+
- **External/Affiliate** — Product listed on site but purchased externally
|
|
23
|
+
|
|
24
|
+
## CRUD Workflow: Simple Product
|
|
25
|
+
|
|
26
|
+
1. Check existing categories: `wc_list_product_categories`
|
|
27
|
+
2. Create product: `wc_create_product` with `name`, `type: "simple"`, `regular_price`, `description`, `categories`, `status: "publish"`
|
|
28
|
+
3. Set stock: include `manage_stock: true`, `stock_quantity`, `stock_status` in create payload
|
|
29
|
+
4. Verify: `wc_get_product` with the returned ID
|
|
30
|
+
|
|
31
|
+
## CRUD Workflow: Variable Product
|
|
32
|
+
|
|
33
|
+
1. Create parent product: `wc_create_product` with `type: "variable"`, add `attributes` array (e.g., `[{name: "Size", options: ["S","M","L"], variation: true}]`)
|
|
34
|
+
2. List variations: `wc_list_product_variations` with parent product ID
|
|
35
|
+
3. Update each variation: `wc_update_product` on variation ID to set `regular_price`, `sku`, `stock_quantity`
|
|
36
|
+
4. Publish parent: `wc_update_product` with `status: "publish"`
|
|
37
|
+
|
|
38
|
+
## Bulk Operations
|
|
39
|
+
|
|
40
|
+
- **List with filters**: `wc_list_products` supports `per_page` (max 100), `page`, `status`, `category`, `stock_status`, `sku`, `search`
|
|
41
|
+
- **Batch stock update**: iterate over product IDs calling `wc_update_product` per product
|
|
42
|
+
- **Draft then publish**: create products with `status: "draft"`, review, then `wc_update_product` to set `status: "publish"`
|
|
43
|
+
|
|
44
|
+
## Image Management
|
|
45
|
+
|
|
46
|
+
Images are set via the `images` array on `wc_create_product` or `wc_update_product`:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
"images": [{"src": "https://example.com/image.jpg", "name": "Product Image", "alt": "Alt text"}]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `upload_media` (WP REST Bridge) first to upload to the WordPress media library, then reference the returned URL in the product images array.
|
|
53
|
+
|
|
54
|
+
## Tips and Gotchas
|
|
55
|
+
|
|
56
|
+
- **Sale price**: Set both `regular_price` and `sale_price` to activate a sale; omit `sale_price` or set to `""` to end it.
|
|
57
|
+
- **SKU uniqueness**: SKUs must be unique across all products. WooCommerce rejects duplicate SKUs.
|
|
58
|
+
- **Variable products**: The parent product itself has no price — price is set on each variation.
|
|
59
|
+
- **Categories must exist**: `wc_create_product` references category IDs; create categories via WP admin first.
|
|
60
|
+
- **Stock status**: Even with `manage_stock: false`, set `stock_status: "instock"` to make the product purchasable.
|
|
61
|
+
- **Delete is permanent**: `wc_delete_product` bypasses trash. Always confirm with user before deleting.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Shipping Setup
|
|
2
|
+
|
|
3
|
+
WooCommerce shipping is organized into zones (geographical regions) with one or more shipping methods per zone. Shipping classes allow different rates for different product types within the same zone. The REST API provides read access to zones and methods for inspection and reporting.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_list_shipping_zones` | List all configured shipping zones with methods |
|
|
10
|
+
|
|
11
|
+
Note: Shipping configuration (creating zones, adding methods, setting rates) requires WooCommerce admin UI or direct REST API calls beyond the current tool set. Use `wc_list_shipping_zones` to inspect and document existing configuration.
|
|
12
|
+
|
|
13
|
+
## Shipping Architecture
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Shipping Zone (e.g., "Europe")
|
|
17
|
+
├── Regions: countries/states/postcodes
|
|
18
|
+
└── Methods:
|
|
19
|
+
├── Flat Rate ($5.99)
|
|
20
|
+
├── Free Shipping (orders > $75)
|
|
21
|
+
└── Local Pickup
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Shipping Zones
|
|
25
|
+
|
|
26
|
+
Each zone defines:
|
|
27
|
+
- **Regions**: Countries, states, or postcode ranges covered
|
|
28
|
+
- **Methods**: Available shipping options for customers in those regions
|
|
29
|
+
- **Priority**: Zones are evaluated in order; first matching zone wins
|
|
30
|
+
|
|
31
|
+
A special **"Rest of the World"** zone (ID: 0) catches all locations not covered by other zones.
|
|
32
|
+
|
|
33
|
+
## Shipping Methods
|
|
34
|
+
|
|
35
|
+
| Method | Configuration |
|
|
36
|
+
|--------|---------------|
|
|
37
|
+
| Flat Rate | Fixed fee per order or per item; can vary by shipping class |
|
|
38
|
+
| Free Shipping | Triggered by minimum order amount, coupon, or always free |
|
|
39
|
+
| Local Pickup | In-store collection; optionally charge a handling fee |
|
|
40
|
+
| Table Rate (extension) | Complex rules by weight, quantity, destination |
|
|
41
|
+
|
|
42
|
+
## Shipping Classes
|
|
43
|
+
|
|
44
|
+
Shipping classes let you charge different flat rates for different product types within the same zone:
|
|
45
|
+
|
|
46
|
+
- **Example classes**: "Heavy items", "Fragile", "Oversized"
|
|
47
|
+
- Products are assigned to a class in the product editor
|
|
48
|
+
- Flat Rate methods can define per-class costs
|
|
49
|
+
|
|
50
|
+
## Free Shipping Thresholds
|
|
51
|
+
|
|
52
|
+
Free shipping can be configured to activate when:
|
|
53
|
+
- Order subtotal reaches a minimum (e.g., $75+)
|
|
54
|
+
- Customer applies a valid free-shipping coupon
|
|
55
|
+
- Both conditions are met (`minimum_amount` AND coupon)
|
|
56
|
+
|
|
57
|
+
## Common Inspection Procedure
|
|
58
|
+
|
|
59
|
+
### Audit Current Shipping Configuration
|
|
60
|
+
|
|
61
|
+
1. `wc_list_shipping_zones` — list all zones
|
|
62
|
+
2. Review each zone's regions and methods from the response
|
|
63
|
+
3. Identify gaps: regions with no zone coverage, zones with no methods, or disabled methods
|
|
64
|
+
4. Document findings and recommend corrections via WooCommerce admin
|
|
65
|
+
|
|
66
|
+
### Verify Free Shipping Availability
|
|
67
|
+
|
|
68
|
+
1. `wc_list_shipping_zones` — find zones with free shipping methods
|
|
69
|
+
2. Check `settings` on the free shipping method for the minimum amount condition
|
|
70
|
+
3. Cross-reference with any coupon that grants `free_shipping: true`
|
|
71
|
+
|
|
72
|
+
## Tips and Gotchas
|
|
73
|
+
|
|
74
|
+
- **Zone order matters**: WooCommerce evaluates zones top to bottom. Place more specific zones (e.g., a specific country) above broader ones (e.g., the continent).
|
|
75
|
+
- **Default zone**: If no zone matches a customer's address, no shipping methods are shown and checkout is blocked. Always configure a "Rest of the World" zone.
|
|
76
|
+
- **Shipping class costs**: Flat rate costs can include PHP calculations referencing `[qty]` and `[fee]` placeholders — document these carefully.
|
|
77
|
+
- **Free shipping with coupon**: A coupon with `free_shipping: true` overrides all method costs for the matching zone, not just "Free Shipping" methods.
|
|
78
|
+
- **Local pickup and tax**: Tax on local pickup orders may differ by jurisdiction — verify WooCommerce tax settings when local pickup is enabled.
|
|
79
|
+
- **REST API scope**: The `wc/v3` shipping endpoints are read-only in the current tool set; use WooCommerce admin for configuration changes.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Tax Configuration
|
|
2
|
+
|
|
3
|
+
WooCommerce tax configuration defines how tax is calculated, displayed, and applied across different products and customer locations. Correct tax setup is critical for legal compliance, particularly for stores selling across multiple jurisdictions.
|
|
4
|
+
|
|
5
|
+
## MCP Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Usage |
|
|
8
|
+
|------|-------|
|
|
9
|
+
| `wc_get_tax_classes` | List all defined tax classes |
|
|
10
|
+
|
|
11
|
+
Note: Creating tax rates and modifying tax settings requires WooCommerce admin UI or direct REST API calls beyond the current tool set. Use `wc_get_tax_classes` to inspect existing classes.
|
|
12
|
+
|
|
13
|
+
## Tax Classes
|
|
14
|
+
|
|
15
|
+
WooCommerce has three built-in tax classes plus custom classes:
|
|
16
|
+
|
|
17
|
+
| Class | Slug | Typical Use |
|
|
18
|
+
|-------|------|-------------|
|
|
19
|
+
| Standard | (default) | Most physical goods |
|
|
20
|
+
| Reduced Rate | `reduced-rate` | Food, books (EU reduced VAT) |
|
|
21
|
+
| Zero Rate | `zero-rate` | Children's clothing, exports |
|
|
22
|
+
| Custom | user-defined | Country-specific requirements |
|
|
23
|
+
|
|
24
|
+
Products are assigned to a tax class. If no class is set, the Standard rate applies.
|
|
25
|
+
|
|
26
|
+
## Tax Rates Structure
|
|
27
|
+
|
|
28
|
+
Each tax rate is defined by:
|
|
29
|
+
|
|
30
|
+
| Field | Description |
|
|
31
|
+
|-------|-------------|
|
|
32
|
+
| Country | ISO 3166-1 alpha-2 country code (e.g., `IT`, `DE`, `US`) |
|
|
33
|
+
| State | State/province code or `*` for all |
|
|
34
|
+
| Postcode | Specific postcode range or `*` for all |
|
|
35
|
+
| City | Specific city or `*` for all |
|
|
36
|
+
| Rate | Percentage (e.g., `22.0000` for 22% Italian VAT) |
|
|
37
|
+
| Name | Label shown to customer (e.g., "VAT") |
|
|
38
|
+
| Priority | When multiple rates match, higher priority wins |
|
|
39
|
+
| Compound | Whether this rate is applied on top of other taxes |
|
|
40
|
+
| Shipping | Whether this rate applies to shipping charges |
|
|
41
|
+
|
|
42
|
+
## Tax Display Options
|
|
43
|
+
|
|
44
|
+
WooCommerce admin > Settings > Tax:
|
|
45
|
+
|
|
46
|
+
| Setting | Options |
|
|
47
|
+
|---------|---------|
|
|
48
|
+
| Prices entered with tax | Yes (inclusive) or No (exclusive) |
|
|
49
|
+
| Display prices in shop | Including tax / Excluding tax / Both |
|
|
50
|
+
| Display prices in cart | Including tax / Excluding tax / Both |
|
|
51
|
+
| Price display suffix | e.g., "incl. VAT", "excl. tax" |
|
|
52
|
+
|
|
53
|
+
## Common Tax Procedures
|
|
54
|
+
|
|
55
|
+
### Inspect Current Tax Classes
|
|
56
|
+
|
|
57
|
+
1. `wc_get_tax_classes` — list all classes
|
|
58
|
+
2. Review which classes exist and their slugs
|
|
59
|
+
3. Cross-reference with products to identify class assignments
|
|
60
|
+
|
|
61
|
+
### EU VAT Setup (example: Italy)
|
|
62
|
+
|
|
63
|
+
1. In WooCommerce admin, Tax > Standard Rates: add `IT`, `*`, `*`, `*`, `22`, "IVA", priority 1
|
|
64
|
+
2. Reduced Rate tab: add `IT`, rate `10`, for eligible goods
|
|
65
|
+
3. Zero Rate tab: add `IT`, rate `0`, for exempt goods
|
|
66
|
+
4. Enable "Prices entered with tax: Yes" for B2C stores
|
|
67
|
+
|
|
68
|
+
### US Sales Tax
|
|
69
|
+
|
|
70
|
+
1. Add state-level rates for each nexus state (e.g., `US`, `CA`, `*`, `*`, `10.25`, "CA Tax")
|
|
71
|
+
2. Consider automated services (see below) for multi-state compliance
|
|
72
|
+
|
|
73
|
+
## Automated Tax Services
|
|
74
|
+
|
|
75
|
+
For stores with complex multi-jurisdiction requirements:
|
|
76
|
+
|
|
77
|
+
| Service | WooCommerce Integration |
|
|
78
|
+
|---------|------------------------|
|
|
79
|
+
| WooCommerce Tax (TaxJar-powered) | Free with WC account; US-focused |
|
|
80
|
+
| TaxJar | Extension; US + Canada + EU |
|
|
81
|
+
| Avalara AvaTax | Enterprise; global coverage |
|
|
82
|
+
| Quaderno | EU VAT + global digital taxes |
|
|
83
|
+
|
|
84
|
+
## Tips and Gotchas
|
|
85
|
+
|
|
86
|
+
- **Tax-inclusive pricing**: If prices are entered tax-inclusive, WooCommerce back-calculates the tax component. Switching this setting after products are created can cause price discrepancies.
|
|
87
|
+
- **Customer location**: WooCommerce calculates tax based on the customer's shipping address (or billing address if shipping is disabled). Ensure address collection is enabled.
|
|
88
|
+
- **Digital goods (EU VAT MOSS)**: Digital products sold to EU consumers must use the customer's country VAT rate. Use the WooCommerce EU VAT extension for compliance.
|
|
89
|
+
- **B2B exemptions**: Businesses with valid VAT IDs may be exempt. The EU VAT extension handles VAT number validation.
|
|
90
|
+
- **Tax rounding**: WooCommerce rounds tax per line item by default. For high-volume stores, "Round tax at subtotal level" (in advanced tax settings) may reduce rounding errors.
|
|
91
|
+
- **Test before go-live**: Place test orders from different locations and verify tax amounts before launching to customers.
|