=== MaxtDesign Product Bundles ===
Contributors: slaacr
Tags: product bundles, grouped products, bundle pricing, kits, frequently bought together
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 0.1.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell products as a set: a curated fixed kit bought in one add-to-cart and priced as a unit, with correct tax, stock, and block-cart handling.

== Description ==

MaxtDesign Product Bundles adds a dedicated **Bundle** product type. A bundle is
a curated, author-chosen set of products (and specific product variations) that
customers buy together in one add-to-cart, priced as a unit. Compatible with
WooCommerce.

The customer never picks which products are in the bundle. The composition is
fixed by you. The only thing the customer adjusts is quantity.

**What a bundle is**

* A fixed set of products you choose, sold as one kit.
* Author-set per-item quantities, with the option to let customers adjust them.
* Author-pinned product variations (e.g. "Red / Large") as bundle items.

**Pricing modes**

* Sum of the item prices.
* A fixed bundle price.
* A percent or fixed-amount discount off the sum (distributed across the real
  component lines with penny reconciliation, so tax reconciles exactly).
* A per-item price override.

**Built right**

* A dedicated Bundle product type, not a grouped-product hack.
* Real component lines keep their own stock and SKU; bundle stock is the minimum
  buyable across items.
* A bundle item is a real product, so the order is self-describing for fulfilment.
* Zero frontend footprint: no bundle scripts or styles load on pages without a
  bundle, and a fully-locked kit renders with no JavaScript at all. The only
  sitewide addition is a ~450-byte inline consent shim shared by the MaxtCommerce
  suite. No external requests, no jQuery, no webfonts, no tracking.
* Coexists with the rest of the MaxtCommerce suite (Configurator, Companion
  Products) on the same store without collision.

This is the free core. A Pro add-on adds tier/conditional bundle discounts,
templates and cloning, per-bundle analytics, and "frequently bought together"
suggestions.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` and activate it.
2. Ensure WooCommerce is active.
3. Add a new product, choose **Bundle** as the product type, open the **Bundle**
   tab in Product data, add items, and choose a pricing mode.

== Frequently Asked Questions ==

= Can customers choose which products are in the bundle? =

No. A bundle's composition is fixed by the author; customers buy the whole set.
Choose-which / build-your-own experiences belong to the MaxtCommerce Configurator,
not to Bundles.

= Can I use product variations as bundle items? =

Yes. You can pin a specific variation (e.g. "Red / Large") as an item in the free
core.

= Does this work with the block cart and Store API? =

Yes. Bundle cart integrity is built on the commerce-core Store API path, and works
on both the block cart and the classic shortcode cart. Bundle lines are locked to
their bundle quantity, the price is always recalculated server-side from the stored
bundle, and removing a component removes the whole bundle rather than orphaning it.

= Do bundled items keep their own stock? =

Yes. Each component is a real product line that decrements its own stock and SKU.

== Screenshots ==

1. A bundle on the product page: a compact grid of exactly what is included, the saving versus buying separately, and one Add to Cart.
2. Building a bundle in the product editor: search products (or pin a specific variation), set per-item quantities, and choose a pricing mode.
3. The cart: the bundle plus its real component lines. Component quantities are locked to the bundle, so the group can never be desynchronised.
4. Display settings: list or grid, thumbnails, quick view, and the savings line.

== Changelog ==

= 0.1.2 =
* Fix: adding a regular (non-bundle) product to the cart could fail with "Please
  reload the page and choose your bundle quantities again." Saving any product
  wrote bundle data onto it, because the Bundle panel's enable checkbox defaulted
  on. Bundle data is now only saved to, and only read from, actual Bundle-type
  products, so regular products add to the cart normally. Existing affected
  products are corrected automatically, with no re-save needed. Thanks to the
  reporter on the support forum for the clear diagnosis.

= 0.1.1 =
* Migration: the WPC Product Bundles importer is now fully implemented (both
  the v7+ array format and the legacy delimited string format, including SKU
  entries and pinned variations). Fixed, discounted, and sum pricing map to
  the equivalent mode; optional-item and choose-a-variation bundles are
  flagged and skipped, never mis-imported.
* Performance: bundle prices on cart and checkout are now computed once per
  composition per request instead of once per pass.

= 0.1.0 =
* Data model + authoring: the Bundle product type, split storage, pricing engine,
  and the customer-facing bundle contents + running total on the product page.
* Cart and order integration: one add-to-cart, server-authoritative pricing, locked
  component quantities, orphan protection, real per-component stock and SKU
  decrements, and order-again support. Works on the block cart and the classic cart.
* Enriched bundle display: list or image-grid layout, lazy thumbnails, per-item
  "View" links (new tab), an optional image quick-view lightbox (off by default),
  and a "you save $X" line. Configure under MaxtDesign > Bundle Display. All free,
  page-scoped, and lean by default (no JavaScript unless a quantity is adjustable
  or the lightbox is enabled).
