=== BeziWorld Inventory Manager for WooCommerce ===
Contributors: beziworld
Tags: woocommerce, inventory, stock, low stock, stock alerts
Requires at least: 6.4
Tested up to: 7.0
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Flexible WooCommerce stock management on a single screen: shortage detection, batched AJAX bulk updates and inline per-row stock editing.

== Description ==

**BeziWorld Inventory Manager for WooCommerce** turns warehouse stock control into a single, fast admin screen. List every product and variation, spot shortages at a glance, and update stock either in bulk or row-by-row — without leaving the page.

= What this plugin gives you =

* A dedicated **Inventory** screen under the WooCommerce *Products* menu
* One unified list of **simple products, variable parents and their variations**
* **Shortage detection** with colour-coded badges: in stock, low stock, partial shortage, total shortage
* **Low-stock detection** using each product's WooCommerce low-stock amount, with a global fallback you can filter
* Aggregated variation stock on the parent row (sum, with `≥` when some variations are unmanaged)
* **Bulk stock updates over AJAX** — set, increase or decrease the stock of every selected row
* Large catalogues are processed in **batches** so the browser never times out; variations of a selected parent are chunked automatically
* **Inline per-row editing** with a "Save all" action that persists every changed quantity at once
* Optional automatic **enable stock management** and **status recalculation** (instock / outofstock) on update
* **Server-side filtering** by shortage or low stock, **search by name or SKU** (including variation SKUs) and **sortable columns** (name, SKU, quantity, status) — all resolved in SQL
* **CSV export** of the current, filtered list (honours search, filters and sort)
* **Low-stock e-mail alerts** — a periodic digest of low/out-of-stock products sent to one or more recipients (configurable frequency)
* **Per-product / per-variation alert rules** — set each product or variation to always alert, never alert, or follow the global setting, and route its alerts to specific recipients
* **Stock change history** with one-click **undo** of the last bulk/inline operation
* **CSV stock import** with a dry-run preview (match by SKU or ID)
* **REST API** under `/wp-json/bzim/v1/` for headless, mobile and WMS integrations
* **WP-CLI** commands (`wp bzim list/set/report/alerts`)
* **Stock report** (units & value) and an **inventory dashboard widget**
* **Warehouse locations** — track stock per location (simple products); the total is the sum of all locations
* Translated into English, Polish, German, Czech and French
* Pagination tuned for big catalogues
* Product image thumbnails with a click-to-zoom lightbox
* Capability-gated (`manage_woocommerce`), nonce-protected AJAX endpoints
* WooCommerce **HPOS (custom order tables) compatible**
* Fully internationalised; ships with a translation template (`.pot`)

= Built for speed on large catalogues =

* Product and variation objects are primed in a single cache pass to avoid N+1 queries
* Shortage filtering, search and sorting happen at the database level, not in PHP
* Bulk operations are queued client-side and dispatched in configurable batches

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/beziworld-inventory-manager-for-woocommerce` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the *Plugins* screen in WordPress.
3. Make sure WooCommerce is installed and active.
4. Open **Products → Inventory** to manage your stock.

== Frequently Asked Questions ==

= Does this require WooCommerce? =

Yes. The plugin manages WooCommerce product stock and will show an admin notice if WooCommerce is not active.

= Does it change my data on uninstall? =

Stock itself lives in WooCommerce product meta and is never touched on uninstall. The plugin's own data — the alert-settings option and the stock-history log table — is removed on uninstall.

= Can it handle thousands of products? =

Yes. Filtering, search and sorting are performed in SQL, objects are batch-primed, and bulk updates are dispatched in batches to avoid timeouts.

= Who can access the screen? =

Any user with the `manage_woocommerce` capability (shop managers and administrators by default).

== Screenshots ==

1. The Inventory screen with shortage badges and inline stock inputs.
2. Bulk stock update controls.
3. Filters, search and sorting.

== Changelog ==

= 2.0.0 =
* Added warehouse locations (multi-location stock) for simple products; the WooCommerce total is the sum of all locations.

= 1.9.0 =
* Added a Stock Report screen (units and value) and an inventory dashboard widget.

= 1.8.0 =
* Added WP-CLI commands (wp bzim list/set/report/alerts).

= 1.7.0 =
* Added a REST API under /wp-json/bzim/v1/ (list, read, update, bulk).

= 1.6.0 =
* Added CSV stock import with a dry-run preview (match by SKU or ID); imports are logged.

= 1.5.0 =
* Added a stock change history (audit log) with a "Stock History" screen and one-click undo of the last operation. Added German, Czech and French translations.

= 1.4.0 =
* Added per-product and per-variation alert overrides (mode + product-specific recipients); the alert digest is now sent per recipient. Added a "Send test e-mail" button on the Stock Alerts screen. Added support for the new block-based WooCommerce product editor (alert fields appear in the Inventory section).

= 1.3.0 =
* Added low-stock e-mail alerts: a "Stock Alerts" settings screen with recipient addresses, frequency and scope, sending a periodic digest of low/out-of-stock products.

= 1.2.0 =
* Added low-stock detection (per-product threshold with global fallback, filterable) with a "Low stock" badge and a "Low stock only" filter.
* Added a "Products per page" screen option.

= 1.1.0 =
* Added sortable column headers and CSV export of the filtered list. Redesigned the filter bar for alignment and readability.

= 1.0.0 =
* Initial release: inventory list, shortage detection, AJAX bulk updates, inline per-row saving, SQL-level filtering/search/sorting, HPOS compatibility.

== Upgrade Notice ==

= 2.0.0 =
Adds warehouse locations (multi-location stock). Additive and dormant until you define locations.

= 1.9.0 =
Adds a stock report and dashboard widget.

= 1.8.0 =
Adds WP-CLI commands.

= 1.7.0 =
Adds a REST API for integrations.

= 1.6.0 =
Adds CSV stock import with a preview.

= 1.5.0 =
Adds stock change history with undo, plus German, Czech and French translations.

= 1.4.0 =
Adds per-product / per-variation alert rules and recipients.

= 1.3.0 =
Adds low-stock e-mail alerts with a settings screen.

= 1.2.0 =
Adds low-stock detection and a low-stock filter.

= 1.1.0 =
Adds sortable columns and CSV export.

= 1.0.0 =
Initial release.
