@ikas/bp-storefront 1.4.0-beta.132 → 1.4.0-beta.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -724,9 +724,17 @@ export declare function getProductVariantCampaignOffersDiscountPercentage(varian
|
|
|
724
724
|
* A tiered discount defines multiple quantity tiers (`campaign.tieredDiscount.rules`), each with its own
|
|
725
725
|
* amount and quantity range. This resolves every tier against the variant's price and returns the
|
|
726
726
|
* per-tier sell/final prices (both raw numbers and formatted strings), matching the storefront runtime.
|
|
727
|
+
* The raw rules are `IkasProductTieredDiscountRule` (ranges may be null); this function returns the
|
|
728
|
+
* resolved `IkasTieredDiscountProduct` with normalized `{ min, max }` — use the resolved shape, not the raw rule.
|
|
729
|
+
*
|
|
730
|
+
* `sellPrice`/`finalPrice` (and their `formatted*` variants) are PER UNIT; the `*WithQuantity` fields are the
|
|
731
|
+
* tier total for buying the minimum quantity. A `"FIXED_AMOUNT"` discount is applied only to that total, so
|
|
732
|
+
* per-unit `finalPrice` equals `sellPrice` and the saving shows only in `finalPriceWithQuantity`.
|
|
727
733
|
*
|
|
728
734
|
* The discount `amount` is interpreted by `campaign.type`: `"RATIO"` treats it as a percentage,
|
|
729
|
-
* `"FIXED_AMOUNT"` as an absolute money amount subtracted from the tier total.
|
|
735
|
+
* `"FIXED_AMOUNT"` as an absolute money amount subtracted from the tier total. `amount`/`type` are
|
|
736
|
+
* informational — the discount is already applied in the resolved `*Price` fields, so prefer those over
|
|
737
|
+
* recomputing it yourself.
|
|
730
738
|
*
|
|
731
739
|
* `lineItemQuantityRange.min`/`max` are normalized numbers where `0` means "unbounded". In particular
|
|
732
740
|
* `max === 0` marks an open-ended top tier (e.g. "6+" with no upper limit) — render it as "min+" rather
|