From 7c3cfbaa8d170830961f348f011c6c056375f8c8 Mon Sep 17 00:00:00 2001 From: Alexander Maushammer Date: Fri, 14 Jun 2024 08:56:58 +0200 Subject: [PATCH 1/2] consider quantity for addon price --- frontend/components/pricing/PremiumAddonBox.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/components/pricing/PremiumAddonBox.vue b/frontend/components/pricing/PremiumAddonBox.vue index d2bde680f..e6e775a45 100644 --- a/frontend/components/pricing/PremiumAddonBox.vue +++ b/frontend/components/pricing/PremiumAddonBox.vue @@ -21,17 +21,17 @@ const quantityForPurchase = ref(1) const prices = computed(() => { const mainPrice = props.isYearly ? props.addon.price_per_year_eur / 12 : props.addon.price_per_month_eur - - const savingAmount = props.addon.price_per_month_eur * 12 - props.addon.price_per_year_eur + const quantity = quantityForPurchase.value || 1 + const savingAmount = (props.addon.price_per_month_eur * 12 - props.addon.price_per_year_eur) * quantity const savingDigits = savingAmount % 100 === 0 ? 0 : 2 return { - main: formatPremiumProductPrice($t, mainPrice), - monthly: formatPremiumProductPrice($t, props.addon.price_per_month_eur), - monthly_based_on_yearly: formatPremiumProductPrice($t, props.addon.price_per_year_eur / 12), - yearly: formatPremiumProductPrice($t, props.addon.price_per_year_eur), + main: formatPremiumProductPrice($t, mainPrice * quantity), + monthly: formatPremiumProductPrice($t, props.addon.price_per_month_eur * quantity), + monthly_based_on_yearly: formatPremiumProductPrice($t, props.addon.price_per_year_eur / 12 * quantity), + yearly: formatPremiumProductPrice($t, props.addon.price_per_year_eur * quantity), saving: formatPremiumProductPrice($t, savingAmount, savingDigits), - perValidator: formatPremiumProductPrice($t, mainPrice / props.addon.extra_dashboard_validators, 5) + perValidator: formatPremiumProductPrice($t, mainPrice / props.addon.extra_dashboard_validators * quantity, 5) } }) From e2d86a28db644e5de09c3e61c864849e8da9c7ca Mon Sep 17 00:00:00 2001 From: Alexander Maushammer Date: Fri, 14 Jun 2024 09:35:49 +0200 Subject: [PATCH 2/2] to much multiplying --- frontend/components/pricing/PremiumAddonBox.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/pricing/PremiumAddonBox.vue b/frontend/components/pricing/PremiumAddonBox.vue index e6e775a45..e3b9c10e3 100644 --- a/frontend/components/pricing/PremiumAddonBox.vue +++ b/frontend/components/pricing/PremiumAddonBox.vue @@ -31,7 +31,7 @@ const prices = computed(() => { monthly_based_on_yearly: formatPremiumProductPrice($t, props.addon.price_per_year_eur / 12 * quantity), yearly: formatPremiumProductPrice($t, props.addon.price_per_year_eur * quantity), saving: formatPremiumProductPrice($t, savingAmount, savingDigits), - perValidator: formatPremiumProductPrice($t, mainPrice / props.addon.extra_dashboard_validators * quantity, 5) + perValidator: formatPremiumProductPrice($t, mainPrice / props.addon.extra_dashboard_validators, 5) } })