How to Calculate Days with Different Prices in WordPress Forms
This form example shows how you can set different prices for the number of days in the date range element, retrieve the number of selected days and retrieve the price per day.
The main calculation part in this form is handled by the discount section in the Daterange element:
The discount section in this form works like this:
- If the number of days is less than or equals 1, the price per day (factor) is 10
- If the number of days is between 2 and 4, the price per day is 8
- If the number of days is more than or equals 5, the price per day is 5
Download form (v184.108.40.206 or higher required)