How to Use our Joomla® Extensions e4j Knowledge Base

Knowledge Base  >  Vik Rent Car  >  Pricing & Availability  >  Promotions calculated on "final cost"

Promotions calculated on "final cost"

1.14

This example will show you in deep how the calculation of the final cost is made.

Let's assume the following scenario:

  • Rental of 5 days in September.
  • Car base cost = €80/night
  • Price modification of -15% for 2 nights
  • Price modification of -5% for 1 night
  • Price modification of +30% for 2 nights
  • One promotion that applies 10% off on 3 days booked
  • Another promotion that applies 50% off on 1 day booked

This is a mix of any possible pricing rule, where there are charges and discounts as well as multiple promotions affecting overlapping stay dates.

Before applying the Promotions, these were our costs for the days of September, where € 80 is our starting from price defined in the page Fares Table:

Booked days September 1st September 2nd September 3rd September 4th September 5th
Price modifications € 80 - 15% € 80 - 15% € 80 - 5% € 80 +30% € 80 +30%
Price difference -12 -12 -4 +24 +24
Cost per day € 68 € 68 € 76 € 104 € 104

Without applying any promotions, and by assuming we have different rates on any days of the year or week-day, our final cost for 5 days of rental in these dates would be € 420 (68+68+76+104+104).

Since we want to show a complex example, we decide to apply 2 different Promotions on these days, one promotion will touch 3 of the 5 days booked, another promotion will touch 1 day of out of 5 booked, and one day will not be modified:

Booked days September 1st September 2nd September 3rd September 4th September 5th
Promotion #1 10% off 10% off 10% off ---- ----
Promotion #2 ---- ---- ---- ---- 50% off

Given the above scenario, our Promotions can be applied in two different methods (starting from Vik Rent Car v1.14):

  1. Progressively, on each night of stay taking the car base cost (Promotion parameter "Apply on cars final cost" disabled).
  2. On the Cars Final Cost by turning on the apposite parameter from the edit page of your Promotion (Special Price).

This is how the system will apply the two promotions "Progressively", so with the method #1, to obtain the final cost for these particular 5 days of stay:

Booked days September 1st September 2nd September 3rd September 4th September 5th Final cost
15% off - 12 - 12 ---- ---- ----  
5% off ---- ---- - 4 ---- ----  
+30% ---- ---- ---- + 24 + 24  
Promo 10% off - 8 - 8 ---- ---- ----  
Promo 50% off ---- ---- ---- ---- - 40  
Calculated cost 80 - 12 - 8 80 - 12 - 8 80 - 4 - 8 80 + 24 80 + 24 - 40 € 356

Instead, this is how the second calculation method would work, if we wanted to apply the two Promotions on the final cost (method #2):

Booked days September 1st September 2nd September 3rd September 4th September 5th Final cost
15% off - 12 - 12 ---- ---- ----  
5% off ---- ---- - 4 ---- ----  
+30% ---- ---- ---- + 24 + 24  
Promo 10% off - 8 - 8 ---- ---- ----  
Promo 50% off ---- ---- ---- ---- - 40  
Calculated cost 80 - 12 - 8 80 - 12 - 8 80 - 4 - 8 80 + 24 80 + 24 - 40 € 356
Factor #1 Promo 10% off -12 * 10 / 100 -12 * 10 / 100 -4 * 10 / 100 +24 * 10 / 100 +24 * 10 / 100 € 2
Factor #2 Promo 50% off -12 * 50 / 100 -12 * 50 / 100 -4 * 50 / 100 +24 * 50 / 100 +24 * 50 / 100 € 10
Final car cost with Factors           356 - 2 - 10 = € 344

The Factors are used to apply the promotions on the final car cost. This very complex example had mixed and overlapping dates, multiple promotions affecting just some and different days, and it shows a full calculation that highlights the difference with the two calculation methods.

Let's take an easier example to see how a promotion applied "progressively" will return a different cost than a promotion applied on the "cars final cost".

Example #4-BIS - One promotion on all the 5 days booked:

We use the same pricing scenario as the one described for the example above.

Booked days September 1st September 2nd September 3rd September 4th September 5th
Price modifications € 80 - 15% € 80 - 15% € 80 - 5% € 80 +30% € 80 +30%
Price difference -12 -12 -4 +24 +24
Final cost per day € 68 € 68 € 76 € 104 € 104

If we sum the cost for each day booked, the total will be € 420. Now let's consider just one Promotion to be applied on all 5 days booked, that applies 10% off.

- Result with the Promotion applied "Progressively" (parameter "Apply on cars final cost" disabled) - method #1:

Booked days September 1st September 2nd September 3rd September 4th September 5th Final cost
Price modifications € 80 - 15% € 80 - 15% € 80 - 5% € 80 +30% € 80 +30%  
Price difference -12 -12 -4 +24 +24  
Promo 10% off difference -8 -8 -8 -8 -8  
Calculations per night 80 - 12 - 8 80 - 12 - 8 80 - 4 - 8 80 + 24 - 8 80 + 24 - 8  
Final cost 60 60 68 96 96 € 380

Instead, if we would like to apply 10% off on the final cost, to obtain a simple result of € 420 - 10% (€ 378), then the system will use the following calculation for the method #2:

Booked days September 1st September 2nd September 3rd September 4th September 5th Final Cost
Price modifications € 80 - 15% € 80 - 15% € 80 - 5% € 80 +30% € 80 +30%  
Price difference -12 -12 -4 +24 +24  
Promo 10% off difference -8 -8 -8 -8 -8  
Calculated cost 80 - 12 - 8 80 - 12 - 8 80 - 4 - 8 80 + 24 - 8 80 + 24 - 8 € 380
Factor Promo 10% off
-12 * 10 / 100 -12 * 10 / 100 -4 * 10 / 100 +24 * 10 / 100 +24 * 10 / 100 € 2
Final cars cost with Factors           380 - 2 = € 378

This complex math operation is fundamental to proportionally and progressively apply the pricing modifications of the Special Prices, which can be used to define Promotions or just Seasonal Rates.

In the last table above, it is true that € 420 - 10% = € 378, but that's not the math operation the system performs, it is rather the one displayed within the table row of the "Factor Promo 10% off".

This is how the Special Prices are applied. You can obviously ignore such complex calculations which only served as an explanation of the algorithm. You can just use the simple and intuitive Pricing Calendar from the page Fares Overview and define some Promotions whenever you need them. This is just the calculation that lies behind.

Last Update: 2020-09-25
Helpful?

Extensionsforjoomla.com is not affiliated with or endorsed by the Joomla!® Project or Open Source Matters.
The Joomla!® name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
E4J s.r.l. - VAT N. 06794860483

This site uses cookies. By continuing to browse you accept their use. Further information