@ikas/bp-storefront 1.4.0-beta.130 → 1.4.0-beta.132

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.
@@ -732,6 +732,9 @@ export declare function getProductVariantCampaignOffersDiscountPercentage(varian
732
732
  * `max === 0` marks an open-ended top tier (e.g. "6+" with no upper limit) — render it as "min+" rather
733
733
  * than "min–max", and never treat `max` as a real quantity when it is `0`.
734
734
  *
735
+ * Each tier's `salesChannelIds` lists the channels it targets (empty/null = all channels). Filter tiers
736
+ * against `IkasStorefrontConfig.salesChannelId` so only those valid for the current storefront are shown.
737
+ *
735
738
  * Returns an empty array when the variant has no tiered-discount campaign, when a
736
739
  * `PRODUCT_AND_VARIANT` filter excludes this variant, or when no tier defines a quantity range.
737
740
  *
@@ -743,23 +746,36 @@ export declare function getProductVariantCampaignOffersDiscountPercentage(varian
743
746
  *
744
747
  * @example
745
748
  * ```typescript
746
- * import { getProductVariantTieredDiscountProducts, getSelectedProductVariant } from "@ikas/bp-storefront";
749
+ * import {
750
+ * getProductVariantTieredDiscountProducts,
751
+ * getSelectedProductVariant,
752
+ * IkasStorefrontConfig,
753
+ * } from "@ikas/bp-storefront";
747
754
  * import { IkasProduct } from "@ikas/bp-storefront";
748
755
  *
749
756
  * function TieredDiscountTable({ product }: { product: IkasProduct }) {
750
757
  * const variant = getSelectedProductVariant(product);
751
758
  * const tiers = getProductVariantTieredDiscountProducts(variant);
759
+ * const salesChannelId = IkasStorefrontConfig.salesChannelId;
752
760
  *
753
761
  * if (!tiers.length) return null;
754
762
  *
755
763
  * return (
756
764
  * <ul>
757
- * {tiers.map((tier, i) => (
758
- * <li key={i}>
759
- * Buy {tier.lineItemQuantityRange.min}+ → {tier.formattedFinalPriceWithQuantity}{" "}
760
- * <s>{tier.formattedSellPriceWithQuantity}</s>
761
- * </li>
762
- * ))}
765
+ * {tiers.map((tier, i) => {
766
+ * // A tier applies when it targets no channels or includes the current one
767
+ * const scoped =
768
+ * !tier.salesChannelIds?.length ||
769
+ * (!!salesChannelId && tier.salesChannelIds.includes(salesChannelId));
770
+ * if (!scoped) return null;
771
+ *
772
+ * return (
773
+ * <li key={i}>
774
+ * Buy {tier.lineItemQuantityRange.min}+ → {tier.formattedFinalPriceWithQuantity}{" "}
775
+ * <s>{tier.formattedSellPriceWithQuantity}</s>
776
+ * </li>
777
+ * );
778
+ * })}
763
779
  * </ul>
764
780
  * );
765
781
  * }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "1.4.0-beta.130",
3
+ "version": "1.4.0-beta.132",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",