From f4a88015d706fed79b9dfb60c41f0a0348209a89 Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:23:25 +0200 Subject: [PATCH 1/2] fix: avoid activating upsells from auth toggle button --- .../payment/views/IntegratedCheckoutView/CheckoutView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx b/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx index 840c09311..483958106 100644 --- a/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx +++ b/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx @@ -62,8 +62,11 @@ const CheckoutView = ({ }); function onAuthMethodToggled(authMethod: AuthMethodTypes) { + reset({ + email: '', + password: '', + }); checkoutViewManager.handleAuthMethodChange(authMethod); - reset(); } return ( From 2efddca389aa7962306c27c1127d467f752ce9d9 Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:48:43 +0200 Subject: [PATCH 2/2] feat: discount for coupons who has the fixed price disc --- .../payment/components/checkout/ProductCardComponent.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/payment/components/checkout/ProductCardComponent.tsx b/src/app/payment/components/checkout/ProductCardComponent.tsx index 393768c67..e2d7ae519 100644 --- a/src/app/payment/components/checkout/ProductCardComponent.tsx +++ b/src/app/payment/components/checkout/ProductCardComponent.tsx @@ -61,6 +61,11 @@ export const ProductFeaturesComponent = ({ const planAmount = getProductAmount(selectedPlan.decimalAmount, couponCodeData).toFixed(2); const upsellPlanAmount = upsellManager.amount && getProductAmount(upsellManager.amount, couponCodeData).toFixed(2); + const discountPercentage = + couponCodeData?.amountOff && couponCodeData?.amountOff < selectedPlan.amount + ? ((couponCodeData?.amountOff / selectedPlan.amount) * 100).toFixed(2) + : undefined; + return (
@@ -91,7 +96,7 @@ export const ProductFeaturesComponent = ({

{translate('checkout.productCard.saving', { - percent: couponCodeData?.percentOff, + percent: couponCodeData?.percentOff ?? discountPercentage, })}