diff --git a/src/utils/plans.ts b/src/utils/plans.ts index 2b31221..b8b19cb 100644 --- a/src/utils/plans.ts +++ b/src/utils/plans.ts @@ -94,8 +94,12 @@ export const customButtonLabel = ({ * @returns The highest discount for the plan, or undefined if none found */ export const highestDiscount = ({ plan }: { plan: Plan }): Discount | undefined => { - return plan.discounts?.length > 0 - ? plan.discounts.reduce((prev, current) => + const discounts = [ + ...(plan.discounts || []), + ...(plan?.bundleDiscounts || []), + ]; + return discounts?.length > 0 + ? discounts.reduce((prev, current) => prev.discountedAmount < current.discountedAmount ? prev : current ) : undefined;