Skip to content

Commit b46bad4

Browse files
committed
Fix Double Slider Issue
Signed-off-by: Namanv509 <namanverma00260@gmail.com>
1 parent 0d63739 commit b46bad4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • src/components/Pricing/PricingAddons

src/components/Pricing/PricingAddons/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
345345
if (targetSubAddon?.pricing && targetSubAddon.pricing[value]) {
346346
const option = targetSubAddon.pricing[value];
347347
const pricePerUser = isYearly ? option.yearlyPerUser : option.monthlyPerUser;
348-
const totalPrice = pricePerUser * option.learners;
348+
const multiplier = selectedSubAddOns["academy-practical"] ? 2 : 1;
349+
const totalPrice = pricePerUser * option.learners * multiplier;
349350
const period = isYearly ? "/year" : "/month";
350351
return `${option.learners} learners - ${formatPrice(totalPrice)}${period}`;
351352
}
@@ -386,7 +387,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
386387
}
387388
}}
388389
>
389-
{formatSliderPrice(option.yearlyPerUser / 12, currency)}<br/>{targetSubAddon.unitLabelSingular}/month
390+
{formatSliderPrice((option.yearlyPerUser / 12) * (selectedSubAddOns["academy-practical"] ? 2 : 1), currency)}<br/>{targetSubAddon.unitLabelSingular}/month
390391
</Box>
391392
)}
392393
<Box
@@ -398,7 +399,7 @@ export const PricingAddons = ({ isYearly = false, setIsYearly, currency, enterpr
398399
sm: "0.9rem",
399400
}
400401
}}>
401-
{formatSliderPrice(isYearly ? option.yearlyPerUser : option.monthlyPerUser, currency)}<br/>{targetSubAddon.unitLabelSingular}/{isYearly ? "year" : "month"}
402+
{formatSliderPrice((isYearly ? option.yearlyPerUser : option.monthlyPerUser) * (selectedSubAddOns["academy-practical"] ? 2 : 1), currency)}<br/>{targetSubAddon.unitLabelSingular}/{isYearly ? "year" : "month"}
402403
</Box>
403404
</Box>
404405
),

0 commit comments

Comments
 (0)