> ## Documentation Index
> Fetch the complete documentation index at: https://docs.woopilot.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Store Actions & Visual Diff Staging

> Execute massive WooCommerce catalog updates, price adjustments, and order workflows with 100% visual safety

# Safe Mass Operations & Visual Diff Staging 🛡️

Performing bulk edits directly in the WordPress admin panel or running raw SQL updates is notoriously dangerous: one wrong filter can corrupt thousands of product prices, erase customer metadata, or trigger unintended email notifications.

WooPilot AI introduces **Visual Diff Staging** — an enterprise safety buffer that ensures **100% of store mutations are visually verified before touching your live database**.

```text theme={null}
┌─────────────────────────────────────────────────────────────────────────────┐
│ 💬 TELEGRAM CHAT PROMPT:                                                    │
│ "Apply a 15% discount on all Winter Jackets with stock > 5 units and        │
│ generate catchy AI SEO product descriptions"                                │
├─────────────────────────────────────────────────────────────────────────────┤
│ 🤖 WOOPILOT AI RESPONSE:                                                    │
│ 🛡️ I have staged 28 product modifications. Inspect the changes below:     │
│ [ 🔍 Review & Apply Changes (28 items) ] <-- (Opens TMA Visual Diff)       │
└─────────────────────────────────────────────────────────────────────────────┘
```

***

## 🧭 How Visual Diff Staging Works

```mermaid theme={null}
sequenceDiagram
    autonumber
    actor Merchant as Store Owner
    participant Bot as Telegram Bot
    participant TMA as Telegram Mini App
    participant Core as Cloud Core Gateway
    participant WP as WooCommerce Store

    Merchant->>Bot: "Apply 15% discount on Winter Jackets..."
    Bot->>Core: Evaluates intent & stages diff
    Core-->>Bot: Returns Staging Deep Link (art_uuid)
    Bot-->>Merchant: Displays Review Button
    Merchant->>TMA: Opens Visual Diff Table
    Note over TMA: Inspects ~~Old Price~~ ➔ New Price
    Merchant->>TMA: Taps [ 🚀 Apply Changes (28 items) ]
    TMA->>Core: Dispatches Chunked Batch Execution
    Core->>WP: Executes via official WooCommerce REST APIs
    WP-->>Core: Confirms 28 items updated
    Core-->>TMA: Updates status to [ ✅ Applied ]
    Core-->>Bot: Updates chat button to [ ✅ Completed (28 items) ]
```

***

## 🔍 Key Safety Guarantees

1. **High-Contrast Visual Diff (`~~Old~~ ➔ New`):**
   * Unaltered metadata (ID, SKU, Title) is locked to the left.
   * Modified fields are highlighted on the right with clear strikethrough comparison badges: `~~$120.00~~ ➔ $102.00`.
2. **Chunked Execution (50 items / 100ms):**
   * Large operations (e.g. 500+ items) are executed in non-blocking batches of 50 items with 100ms pauses to prevent PHP script execution timeouts or server CPU spikes.
3. **Official WooCommerce API Execution (`rest_do_request`):**
   * Mutations are never executed via raw SQL. They pass through official WooCommerce REST controllers, guaranteeing that stock status changes, HPOS synchronizations, cache invalidations, and native hooks fire cleanly.
4. **Stepper Multi-Step Sequences:**
   * Complex workflows (*Step 1: Set discount $\to$ Step 2: Move items to Sale category*) are organized into structured Stepper sequences, guiding you step-by-step.

***

## 💬 Example Bulk Actions

### 1. Catalog & Pricing Operations

```text theme={null}
"Increase prices by 8% across all products in 'Supplements' and round to .99"
"Move out-of-stock items (stock = 0) older than 6 months into Draft status"
"Add tag 'Summer-Sale' to all items with regular_price > $50 and stock > 10"
```

### 2. Order Workflow & Status Management

```text theme={null}
"Change status to 'Completed' for all Processing orders with tracking numbers"
"Add private note 'Fraud Check Passed' to all orders from today > $500"
```

### 3. Coupon & Promotional Generation

```text theme={null}
"Create a 20% discount coupon 'VIP-MARCH' valid for 5 days with minimum spend $100"
"Generate a personal $10 fixed cart coupon for customer@email.com expiring in 48 hours"
```


## Related topics

- [Visual Diff Staging Table](/tma/diff-table-staging.md)
- [Quickstart Guide](/quickstart.md)
- [Team Access & Multi-Store Management](/tma/team-access.md)
- [Frequently Asked Questions](/faq.md)
- [System Architecture](/architecture.md)
