# IAS Bundle Deals — WP-CLI Commands **Slug:** `ias-bundle-deals`  •  **Version:** 1.1.13  •  **Namespace:** `wp ias bundle-deals`  •  **Tier:** Commercial (licence required) > Bundle deals & ownership: list, inspect, create, update, sync and delete bundles. All commands accept `--format=`. Mutating commands support `--dry-run` and `--yes`; destructive commands prompt for confirmation unless `--yes` is passed, and any bulk-delete command refuses to run without an explicit scope argument — a required `--filter` on the record-deletion commands, or another mandatory bound such as `--max-age-days` — rather than defaulting to delete-all. ## Authentication & trust model These commands run under WP-CLI, whose trust boundary is **shell access**: anyone who can run `wp` on the server already has full database and PHP access (`wp db query`, `wp eval`). The CLI therefore adds **no separate capability check** — a `current_user_can()` gate would add no real protection and would wrongly refuse commands run without `--user=` (WP-CLI bootstraps as user 0). Protection for the irreversible commands instead comes from `--dry-run` previews, an explicit confirmation prompt (or `--yes`), a mandatory scope argument on any bulk delete (a `--filter`, or another mandatory bound such as `--max-age-days`), and a before-state entry written to the suite-wide CLI audit log. Commands that cannot be undone are flagged with a **⚠ Irreversible** banner below. ## Index - [`wp ias bundle-deals create`](#wp-ias-bundle-deals-create) - [`wp ias bundle-deals delete`](#wp-ias-bundle-deals-delete) - [`wp ias bundle-deals inspect`](#wp-ias-bundle-deals-inspect) - [`wp ias bundle-deals list`](#wp-ias-bundle-deals-list) - [`wp ias bundle-deals show`](#wp-ias-bundle-deals-show) - [`wp ias bundle-deals sync`](#wp-ias-bundle-deals-sync) - [`wp ias bundle-deals update`](#wp-ias-bundle-deals-update) - [`wp ias bundle-deals validate`](#wp-ias-bundle-deals-validate) ## `wp ias bundle-deals create` Create a new bundle. Delegates to IAS\BundleDeals\Database::create_bundle(). New bundles are created DISABLED unless --enabled is passed, so they never go live before you have reviewed and synced them. ```bash wp ias bundle-deals create --products= --discount= [--enabled] [--dry-run] [--yes] [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `` | yes | positional | Bundle display name. | | `--products=` | yes | flag (value) | Comma-separated WC product IDs. Each must exist, be published and purchasable, and must not itself be a bundle. | | `--discount=` | yes | flag (value) | Discount specification — one of `percent:` (n = 0-100), `fixed:` (flat amount off the regular total), or `bundle:` (a flat total price for the whole bundle). | | `[--enabled]` | no | flag | Create the bundle in the active state (default: disabled). | | `[--dry-run]` | no | flag | Validate and report what would be created without writing anything. | | `[--yes]` | no | flag | Skip the confirmation prompt. | | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals create "Starter Pack" --products=12,34,56 --discount=percent:15 --enabled wp ias bundle-deals create "Flat Bundle" --products=12,34 --discount=bundle:14.99 --dry-run ``` **Related:** `wp ias bundle-deals delete`, `wp ias bundle-deals inspect`, `wp ias bundle-deals list`, `wp ias bundle-deals show`, `wp ias bundle-deals sync`, `wp ias bundle-deals update`, `wp ias bundle-deals validate` ## `wp ias bundle-deals delete` > **⚠ Irreversible — `--dry-run` first.** This command permanently destroys data or applies a terminal state that cannot be undone from the CLI. Preview the exact effect with `--dry-run`, then re-run with `--yes` once you are certain. Delete a bundle and its synced (hidden) WooCommerce product. Force-deletes the linked WC_Product_Simple (via IAS\BundleDeals\BundleProduct::delete_product()) and then removes the bundle row (via IAS\BundleDeals\Database::delete_bundle(), which also flushes the bundle cache). This is NON-RECOVERABLE. For safety the command REFUSES to delete a bundle that has recorded purchases unless --force is given. The purchase guard reads the bundle analytics table (net purchases = purchases minus refunds); if analytics are disabled no purchases are recorded, so pass --force to delete in that case. ```bash wp ias bundle-deals delete [--force] [--dry-run] [--yes] [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `` | yes | positional | Bundle ID. | | `[--force]` | no | flag | Override the purchase guard — delete even if the bundle has recorded purchases. This is NOT the confirmation flag; pass --yes to skip the prompt. | | `[--dry-run]` | no | flag | Report what would be deleted (including whether it would be refused) without writing anything. | | `[--yes]` | no | flag | Skip the confirmation prompt. | | `[--format=]` | no | flag (value) | Output format. | **Returns:** The deleted bundle_id and the linked_product_id that was removed. **Example:** ```bash wp ias bundle-deals delete 12 wp ias bundle-deals delete 12 --force --yes wp ias bundle-deals delete 12 --dry-run ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals inspect`, `wp ias bundle-deals list`, `wp ias bundle-deals show`, `wp ias bundle-deals sync`, `wp ias bundle-deals update`, `wp ias bundle-deals validate` ## `wp ias bundle-deals inspect` Report the plugin slug, version and CLI environment. ```bash wp ias bundle-deals inspect [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals inspect ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals delete`, `wp ias bundle-deals list`, `wp ias bundle-deals show`, `wp ias bundle-deals sync`, `wp ias bundle-deals update`, `wp ias bundle-deals validate` ## `wp ias bundle-deals list` List bundles. ```bash wp ias bundle-deals list [--enabled-only] [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `[--enabled-only]` | no | flag | Only list bundles whose master switch (is_active) is on. | | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals list wp ias bundle-deals list --enabled-only --format=json ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals delete`, `wp ias bundle-deals inspect`, `wp ias bundle-deals show`, `wp ias bundle-deals sync`, `wp ias bundle-deals update`, `wp ias bundle-deals validate` ## `wp ias bundle-deals show` Show a bundle's composition, pricing and schedule. ```bash wp ias bundle-deals show [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `` | yes | positional | Bundle ID. | | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals show 12 --format=json ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals delete`, `wp ias bundle-deals inspect`, `wp ias bundle-deals list`, `wp ias bundle-deals sync`, `wp ias bundle-deals update`, `wp ias bundle-deals validate` ## `wp ias bundle-deals sync` Re-sync a bundle to its linked (hidden) WooCommerce product. Delegates to IAS\BundleDeals\BundleProduct::sync_product(), which creates or updates the hidden WC_Product_Simple that powers native cart/checkout. Use this to repair drift between a bundle definition and its linked product. ```bash wp ias bundle-deals sync [--yes] [--force] [--dry-run] [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `` | yes | positional | Bundle ID. | | `[--yes]` | no | flag | Skip the confirmation prompt (suite-standard for write commands). | | `[--force]` | no | flag | Alias for --yes — re-sync without the confirmation prompt. | | `[--dry-run]` | no | flag | Report what would be synced without writing anything. | | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals sync 12 wp ias bundle-deals sync 12 --yes wp ias bundle-deals sync 12 --dry-run ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals delete`, `wp ias bundle-deals inspect`, `wp ias bundle-deals list`, `wp ias bundle-deals show`, `wp ias bundle-deals update`, `wp ias bundle-deals validate` ## `wp ias bundle-deals update` Update fields on an existing bundle. Delegates to IAS\BundleDeals\Database::update_bundle(); only the fields you pass are changed. Re-validates products and discount when supplied. ```bash wp ias bundle-deals update [--name=] [--products=] [--discount=] [--enabled[=]] [--dry-run] [--yes] [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `` | yes | positional | Bundle ID. | | `[--name=]` | no | flag (value) | New bundle name. | | `[--products=]` | no | flag (value) | New comma-separated WC product IDs (validated as for `create`). | | `[--discount=]` | no | flag (value) | New discount specification (`percent:`, `fixed:`, or `bundle:`). | | `[--enabled[=]]` | no | flag (value) | Set the active state. `--enabled` enables; `--enabled=0` disables. | | `[--dry-run]` | no | flag | Validate and report what would change without writing anything. | | `[--yes]` | no | flag | Skip the confirmation prompt. | | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals update 12 --discount=percent:20 wp ias bundle-deals update 12 --products=12,34,99 --enabled=0 --dry-run ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals delete`, `wp ias bundle-deals inspect`, `wp ias bundle-deals list`, `wp ias bundle-deals show`, `wp ias bundle-deals sync`, `wp ias bundle-deals validate` ## `wp ias bundle-deals validate` Validate a bundle's integrity (products exist, prices/discount sound, synced). ```bash wp ias bundle-deals validate [--format=] ``` | Argument | Required | Type | Description | |----------|----------|------|-------------| | `` | yes | positional | Bundle ID. | | `[--format=]` | no | flag (value) | Output format. | **Example:** ```bash wp ias bundle-deals validate 12 --format=json ``` **Related:** `wp ias bundle-deals create`, `wp ias bundle-deals delete`, `wp ias bundle-deals inspect`, `wp ias bundle-deals list`, `wp ias bundle-deals show`, `wp ias bundle-deals sync`, `wp ias bundle-deals update`