diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue index ed6dc4f5..e3605251 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue @@ -36,13 +36,13 @@
- -
+
Erst ab 30 Personen buchbar.
@@ -170,7 +170,20 @@ export default { optionsJson: { type: String, required: true - } + }, + runningCostsFactor: { + type: Number, + default: 1.7, + }, + shortTermFactors: { + type: Object, + default() { + return { + 2: 0.2, + 3: 0.1, + } + } + }, }, data() { return { @@ -242,7 +255,7 @@ export default { this.selectedRange = range; }, onPaxUpdated() { - if (this.selectedPax < 30) { + if (this.totalPax < 30) { this.selectedBoard = null; } }, @@ -373,11 +386,10 @@ export default { priceShortTerm() { let price = 0; const totalPricePax = (this.pricePax.base + this.pricePax.additional); - if (2 === this.nightsCount) { - price = totalPricePax * 0.2; - } - if (3 === this.nightsCount) { - price = totalPricePax * 0.1; + for (let [nights, factor] of Object.entries(this.shortTermFactors)) { + if (nights === this.nightsCount) { + price = totalPricePax * factor; + } } return price; }, @@ -385,7 +397,7 @@ export default { if (this.selectedBoard) { return 0; } - return this.nightsCount * this.totalPax * 1.7; + return this.nightsCount * this.totalPax * this.runningCostsFactor; }, priceTotal() { return this.pricePax.base + this.pricePax.additional + this.priceOptions