This is an example of a calculator that demonstrates the date-related functions of the plugin, along with hidden intermediate calculation steps.
Price list
Weekdays | Weekends | |
---|---|---|
Regular room | $20 per night | $25 per night |
Deluxe room | $30 per night | $40 per night |
Source code for this form:
<label>Room type [radio deluxe "Regular" "Deluxe"] [variable deluxe_flag cf7-hide "deluxe:" "Regular 0" "Deluxe 1" "default 0"]</label> <label>Check in [date checkin] </label> <label>Check out [date checkout] </label> [calculate_button calculate_button-1 "Calculate"] [calculation total_nights min:0 cf7-hide "checkout-checkin"] [calculation weekday_nights min:0 cf7-hide "fn_business_days(checkin+1, checkout)"] [calculation weekend_nights min:0 cf7-hide "total_nights-weekday_nights"] [calculation weekday_subtotal min:0 cf7-hide "weekday_nights*(20+deluxe_flag*10)"] [calculation weekend_subtotal cf7-hide "weekend_nights*(25+deluxe_flag*15)"] Price estimate: <span id="booking_total">$ [calculation price min:0 "weekday_subtotal + weekend_subtotal"]</span> [paypal paypal-button email:[email protected] field:price currency:USD "Hotel Booking Demo"]