# Changelog

> Release history of Collective Packaging.

Current version: **1.0.0**

## 1.0.0 — 2026-10-19


Rebuild of the open-source `qoliber/m2-product-pack` (2.0.0) under a new name.
Not an in-place upgrade: the `pack` product type, its table and its configuration
paths are gone.

### Verified
- Release gates (unit, integration, browser, static analysis, production DI compile) ran on
  Magento Open Source 2.4.9, PHP 8.3, Luma and Hyvä 1.5.2 (Tailwind CSS 4); the Hyvä
  storefront suite also on Mage-OS 2.3 (Magento 2.4.8-p5) with Hyvä 1.3.22 (Tailwind CSS 3).
  The declared 2.4.6 - 2.4.8, PHP 8.1 / 8.2 / 8.4 / 8.5 and Hyvä 1.2 - 1.5 combinations are
  covered by static guards and a source review of Hyvä 1.3.9, 1.3.22, 1.4.6 and 1.5.3 only.
- Known: a dynamic bundle priced as a pack can differ by one cent between the pack price
  shown and the sum of its selection rows (see the usage pages).

### Fixed (pre-release review)
- Cart offer rows reset between requests in long-running application servers, including
  cached empty results, so a later request always uses its own cart.
- Cart offers compare the real cart total (cart rules and their thresholds, tax) and never
  advertise a saving that raises what the customer pays.
- Cart offers leave lines with decimal quantities alone instead of rounding them.
- Offers and unit plans are priced from the product's own unit price, never from the pack a
  cart line already carries (the stack policy discounted such packs twice).
- Fixed pack amounts reach the storefront in the display currency and tax mode, so live-priced
  selections (bundles) show the right figure.
- Pack-only mode is enforced at the cart on every channel, not only hidden on the product page.
- A variant whose packs belong to another customer group no longer blocks the parent's packs
  at the cart; product page and server apply one rule.
- Credit memos of configurable pack lines return the variant's units once (the parent item is
  no longer counted too); reservation compensation counts the same lines as MSI; refunds of
  invoiced virtual and downloadable packs return units, not packs.
- Selections of a bundle shipped separately weigh their units: the shipping-weight limitation
  is gone.
- A product save that did not touch packs writes nothing; deleting a size and adding it again
  in one save no longer collides on the unique key.
- Production DI compilation works (no object defaults in constructors); the units button binds
  CSP-safely under Hyvä's Alpine build.
- Request-scoped caches reset on long-running processes (through a stand-in interface, so the
  module still loads on Magento 2.4.6); listing lookups are bounded to the listing; product-page
  availability is one salable-quantity lookup per SKU.
- Bundles get their fixed pack amounts in display currency and tax mode too (the first fix
  covered products with precomputed prices only).
- Cart offer amounts are a grand-total difference: converted to the display currency, no
  longer taxed a second time by the catalog display rule.

### Security
- The cart offers and the unit planner never solve more than the configured maximum of
  units (itself capped at 100 000), whatever quantity a cart line carries.
- The unit planner answers only for products the store sells (enabled, in the website).
- The product page's selector configuration is written HTML-safe inside its script block.
- Pack ownership is checked with the quote's customer group on every channel, REST included.

### Added
- Pack options on simple, virtual, downloadable, configurable and bundle products
  (no dedicated product type any more).
- Three price types per option: percent off the unit price, fixed amount off each
  unit, fixed total pack price.
- Website and customer-group targeting, active switch and default option per pack.
- Configurable products: options on the parent apply to every variant; a variant
  with its own options (ones the customer may buy: active, in the website, open to the
  customer's group) replaces the parent list; the server applies the same rule as the
  product page.
- Bundle products: options on the bundle multiply the whole line; options on a
  selection product act as quantity tiers for that selection.
- Server-side validation of the selected pack; the buy request carries only the
  option id and the validated pack is snapshotted on the quote and order items.
- One price calculator shared by the storefront, the cart, REST and the tests.
- MSI reservations, shipments, cancellations and credit memos count physical units
  exactly, including several pack sizes of the same SKU in one order.
- REST endpoints for pack options and a cart item processor for headless carts.
- Buy by units: the product page plans the cheapest exact combination of packs and single
  units for a typed count, never rounding without the shopper choosing an alternative;
  `GET /V1/qoliber-collective-packaging/products/:productId/units-plan` for headless clients.
- One-click cart upgrades: cheaper repackaging of the same units and the next full pack,
  each shown with its true change in the cart total.
- Shareable links: `?collective_pack=ID` preselects a pack, `?collective_units=N` prefills
  the unit count.
- The Packaging row in cart, checkout, order views and emails spells out the price per unit
  ("6-pack (6 units) at $1.08 per unit"), switchable in configuration.
- Dynamic bundle lines show their real line price in the cart's price column; core rebuilt it
  from add-time selection prices, which know neither selection tiers nor packs.
- The product's main price follows the selected pack (pack total or price per unit) on
  Luma and Hyva, and a hint under the selection spells out how the pack price is worked
  out (switchable under *Product Page*).
- Luma pack selector; Hyva selector shipped as `qoliber/collective-packaging-hyva`.
