=== HS Min/Max Quantities for WooCommerce ===
Requires at least: 6.8
Requires PHP: 8.2
Tested up to: 7.1
Stable tag: 0.12.0
License: GPL-2.0-or-later

Local development preview of a fully free purchase-rules plugin.

== Description ==
HS Min/Max Quantities for WooCommerce is a fully free purchase-rules plugin in local development. This build is not ready for public distribution.

Configure purchase quantities and amounts under HookSpark > Min/Max:

* Independent minimum, maximum, pack size and starting quantity.
* Simple products, variable products and explicit variation exceptions.
* Groups selected by products, categories, tags and global attributes, with All/Any matching.
* Individual quantities, combined group quantities and total cart pieces.
* Minimum and maximum amounts, before or after discounts, with explicit tax handling. Shipping and fees can be included only in cart-wide amount rules.
* Rules for guests, signed-in customers, selected roles or individual users. Exclude specific accounts and roles.
* Separate exemptions from a rule and exclusions from combined counts. Exclude categories (including descendants) and tags entirely.
* Searchable rules, inactive copies, reviewed bulk actions and JSON import/export with reference review.
* Draft rule previews, catalog candidates and editable customer messages with example previews.
* Local diagnostic reports that exclude customer/order details and rule names.

No rule is enabled on a fresh installation. Purchase validation runs on the server; changing an input in the browser does not bypass the rules. All applicable rules are considered, with explicit variation exceptions replacing their named parent rule. Some conflicts are detected when saving; this does not replace testing overlapping rules against the real catalog.

== Installation ==
1. Install and activate WooCommerce.
2. Install this plugin ZIP and activate HS Min/Max Quantities for WooCommerce.
3. Open HookSpark > Min/Max.
4. Create a rule, inspect its draft preview and save it.
5. Test the intended product, cart and checkout before using the rule on a live store.

This is a development build intended for a local or staging site. Minimum requirements: WordPress 6.8, WooCommerce 10.6 and PHP 8.2. Native lifecycle checks cover WordPress 6.8 / WooCommerce 10.6.0 and WordPress 7.1 / WooCommerce 11.1.0 on PHP 8.2.29. Other PHP branches are not yet verified.

== Frequently Asked Questions ==

= How do I sell a product in pairs? =
Create a product rule with Minimum 2 and Pack size 2. Leave Maximum empty if you do not need an upper limit. Starting quantity is optional: it changes the initial suggestion, not an existing valid cart quantity. Stock and WooCommerce purchase restrictions still apply.

= What does an empty limit mean? =
It means that constraint is not set. Do not enter zero to mean unlimited. A minimum, maximum, pack size or starting quantity must be a positive whole number when provided. Removing a cart item remains possible.

= Do product variations share a quantity? =
A rule directly targeting a variable product applies to each variation. To combine matching variations, use a group rule with combined counting. A variation exception replaces only the parent rule you explicitly select; unrelated applicable rules still apply.

= What is the difference between an exemption and excluding an item from the count? =
An exempt item can contribute to a combined total but does not trigger that rule by itself. An item excluded from the count does not contribute to that rule's total. Test mixed carts when combining these settings.

= Can I preview a custom message without saving? =
Yes. Default messages offers Preview with example values. Quantity examples use a fictional product; amount examples use a fictional EUR total, independent of your store currency. Editing the text clears the old preview. A variable unavailable in the example causes the built-in explanation to be shown. A rule-specific message takes priority over its global default.

= What happens when I import rules? =
Review product, taxonomy and role matches before confirming. Product IDs from another store are not trusted as destination identities; SKU matches are proposals and ambiguous matches require review. Import adds rules instead of silently replacing existing rules. Reviews expire after 15 minutes. Source default messages can be preserved on imported rules without changing this store's defaults.

= Is the diagnostic report a complete compatibility check? =
No. It checks stored data readability, missing references, currency changes and per-rule availability for directly selected simple products or variations. It does not audit every rule combination, group, audience or checkout integration. Preview the exact report before choosing to download or share it. Rule configuration exports are separate and do include rule/product names and custom messages.

= Which integrations have been tested? =
Local checks cover classic HTTP cart/checkout flows, Store API quantity rejection, variation controls, and order persistence with HPOS enabled. Storefront 4.6.2 has been checked through a classic HTTP purchase flow and browser variation selection. A disposable multisite test verifies separate rule/message storage and network activation. These are bounded development checks, not blanket compatibility declarations. Elementor, the complete Blocks matrix, browser purchase flows and additional environment combinations remain in verification.

= Will deactivation delete my rules? =
Deactivation does not intentionally delete the saved configuration. File replacement from the same-version ZIP has been tested with a saved rule. Historical version migrations and an explicit uninstall data-removal workflow are not yet fully verified in this development build. Keep a configuration export before maintenance.

== Changelog ==

= Theme integration — 19 September 2026 =

* Shared admin confirmation for unsaved changes, with visible recovery and consistent exit behavior across HookSpark plugins.
* Storefront components inherit theme typography and neutral surfaces. Messages buttons use native theme classes; explicit message colors/fonts and semantic presets remain available.


= Local candidate quality fixes — 19 September 2026 =
* Suspend integration when WooCommerce is absent or below 10.6, with an administrator explanation and preserved settings.
* Batch native catalog caches and skip irrelevant product rules before expensive checks.
* Defer product-panel and CSV translations until init.

= 0.12.0 (development) =
* Discover the HookSpark collection in a shared catalog tab, with local assets and native WordPress plugin actions.
* Native product and variation panels link to the shared rule editor, with product preselection and no duplicate settings.
Guard optional AI category registration when the WordPress Abilities API is unavailable.
Added the before-Pricing monetary basis and shared quantity/amount preview integration with HS Dynamic Pricing, while preserving independent operation. Refined rule list and editor, catalog candidate previews, default-message examples, Settings action link, Store API cart quantity validation, diagnostics and guards for damaged stored rules. Expanded local installation, classic checkout and multisite isolation checks. Public release gates remain open.

= 0.11.0 =
Contextual wildcard variation preview with request validation and stale-response protection.

= 0.10.0 =
Row-aware wildcard variation validation and monetary edge-case verification.

= 0.9.0 =
Monetary thresholds, explicit discount/tax basis and cart-only shipping/fees options.

= 0.8.0 =
Separate product exemptions and exclusions from combined counts.

= 0.7.0 =
Audience targeting for guests, authenticated users and selected roles.

= 0.6.0 =
Catalog selectors, All/Any criteria, individual/aggregate counting and paginated term search.

= 0.5.0 =
Per-variation parent rules, explicit parent-rule replacement and classic variation UI updates.

= 0.4.0 =
Combined groups, variable-product aggregation and total cart pieces.

= 0.3.0 =
Independent optional limits, explicit starting quantity and descriptions of configured constraints only.

= 0.2.0 =
Multi-rule editor and list, safe migration, conflict checks and enforcement of all applicable rules.

= 0.1.0 =
Initial local development slice, admin editor and server-side quantity checks.

= Development update — 12 September 2026 =
* Added category/tag exclusions and individual-user inclusion/exclusion, plus excluded user roles.
* JSON v2 preserves targeting; user-specific transfers require the original site/accounts. Storage schema 3 protects against unsafe downgrades.
