== Changelog ==

Older Emporiqa releases. The two most recent versions are in readme.txt.

= 1.1.8 =
* Fix: variable products whose only sellable variations are on backorder are no longer reported as out of stock. The parent now aggregates availability with a three-state ladder (available, then backorder, then out of stock), matching the per-variation availability event so the chat never refuses a sellable variable product.
* Fix: grouped products whose child items are all out of stock now report their real lowest price instead of 0. Price is derived from all children, not just in-stock ones.
* Fix: a variable product's parent now reports the lowest variation price as its headline "from" price (was an arbitrary variation). The full low-to-high range is shown by Emporiqa from the variation data.
* Changed: removed three payload fields that the Emporiqa server does not use (`price_min`, `price_max`, `prices_include_tax`). The price range is derived from variations server-side; no merchant-visible change.

= 1.1.7 =
* New: maximum order quantity per product is now sent to Emporiqa. "Sold individually" (limit purchases to 1 per order) and the maximum from WooCommerce's Min/Max Quantities extension are respected, so the chat won't offer to add more than allowed and the merchant's cart no longer silently rejects an over-the-limit add. Customizable via the new `emporiqa_max_order_quantity` filter.
* New: products are flagged as digital/virtual so the chat answers "do you ship this?" correctly, and an availability-for-order flag lets the chat avoid trying to cart display-only products. Optional product condition (new / used / refurbished) can be supplied via the `emporiqa_product_condition` filter.
* Changed: dropped the unused `backorders_allowed` field from the payload (backorder availability is already conveyed by the availability status).
* Fix: right after a stock change the availability could be reported wrong: a just-sold-out product still shown as available (then rejected at the cart), or a just-restocked product still shown as out of stock. For stock-managed products availability is now derived from the tracked quantity, which is already correct at save time, instead of WooCommerce's stock-status label, which it updates a beat later. Most visible on variations.
* Fix: when a variable product whose variations share parent-level stock goes out of stock, each variation's availability is now updated too. Previously only the parent was, so the chat could keep offering a sold-out variation.
* No action required after upgrading.

= 1.1.6 =
* New: stock and availability changes now sync instantly on their own, without re-sending the whole product. When an order is placed, a product sells out, or you restock, Emporiqa receives a small availability update right away, so the chat never recommends something that just went out of stock, and comes back as soon as it returns.
* Covers manual stock edits, order placement, cancellations and refunds, and updates made through the REST API or WP-CLI.
* No action required after upgrading.

= 1.1.5 =
* New: minimum order quantity per product is now sent to Emporiqa. The chat will respect the minimum order quantity when recommending products or building carts, so "add 1 unit" no longer fails silently on products that require a higher minimum (e.g. wholesale, bulk, or pack-of-N items). Reads the `_minimum_allowed_quantity` post meta used by WooCommerce's official Min/Max Quantities extension and popular free clones. Stores using a different plugin can plug in their own source via the new `emporiqa_min_order_quantity` filter.
* No action required after upgrading. Default minimum stays at 1 for products with no constraint.

= 1.1.4 =
* Compatibility: clarified TranslatePress is not supported. The previous releases only read the language list from TranslatePress and never translated content. Removed the misleading detection so the listed compatibility (WPML, Polylang) reflects what actually ships.
* Reliability: added a defensive hook for WPML's `wpml_translation_update` action so translations created in the Block Editor are re-dispatched once WPML finishes linking them. Same shape of safety net the 1.1.3 release added for Polylang.
* No action required after upgrading.

= 1.1.3 =
* Fix: Polylang translations created in the Block Editor no longer leak into Emporiqa as a separate page in the wrong language. The plugin now waits for Polylang to finish linking the translation before sending.
* Fix: clearer error messages on the Sync and Test Connection screens. Instead of "Unexpected status code: 401" you now see the actual reason from Emporiqa (e.g. invalid signature, rate limit, validation error).
* Reliability: tighter timeouts on background webhook sends so a slow Emporiqa response can't tie up the Action Scheduler queue. Failed sends keep retrying with exponential backoff (60s, 4min, 16min).
* Reliability: queued webhook payloads now survive up to 24 hours in case the WordPress scheduled-action runner is temporarily delayed.
* No action required after upgrading.

= 1.1.2 =
* One-click connect: link the store with a single button (no Store ID or Connection Secret to copy across tabs). Manual paste is still available on the settings page for sites without HTTPS.
* New post-connect welcome card on the Sync tab: one click to send your catalog. The chat widget goes live once the first full sync finishes.
* Reconnect rotates the connection secret automatically.
* Settings panel rewritten in plain language for store owners. Advanced section explains what each option does, in store-owner terms.
* Test Connection shows a clean "Connection successful" message on success. Errors keep the dry-run details for debugging.
* Reliability: product, page, and order updates are sent to Emporiqa in the background. Your admin and checkout pages don't wait on the connection, even if Emporiqa is slow to respond.
* Tested with WordPress 7.0.

= 1.1.1 =
* Parent product SKU now uses the WooCommerce SKU field when set, so customers who type a real SKU find the right product. Re-sync after upgrading.

= 1.1.0 =
* Simplified settings page: Connection Settings is the only section expanded by default
* Order Tracking API URL moved into Connection Settings for easier setup
* Order tracking endpoint is now always registered. It stays protected by HMAC-SHA256 signature verification, a 5-minute timestamp tolerance, and per-IP rate limiting
* Email verification for order tracking is now always required (no longer toggleable)
* Test Connection button and WP-CLI command reference moved to the Sync tab (CLI reference collapsed by default)
* Sync Settings (sync scope, languages, page post types) moved below Advanced and collapsed by default

= 1.0.0 =
* Initial release
* Product and variation synchronization via webhooks
* Simple, variable, grouped, and external product types supported
* Page synchronization for configurable post types
* Multi-language support (Polylang, WPML, WordPress locale)
* Multi-currency support (WOOCS, WPML Multi-Currency, WC Payments, Aelia)
* Embedded chat widget with automatic language and currency detection
* In-chat cart operations with stock and purchasability validation
* Conversion tracking via order completion webhooks (filterable statuses)
* Order tracking REST API with HMAC authentication and rate limiting
* Webhook retry with exponential backoff via Action Scheduler
* Tax-inclusive/exclusive pricing context in product payloads
* Variable product price ranges (min/max)
* Stock reduction re-sync on order placement
* WP-CLI commands for bulk sync operations
* Event deduplication for batch operations
* WordPress filters for data customization

