Suppose you already have a resource with a rule set up. For example, a rental priced at $100 per hour for each item, with only 10 spots available.
To change the price starting from the third hour and beyond, you can use one of three approaches.
You can add a discount for reservations lasting 3 hours or more.
Create a pricing component.
Enter a name for the component. Click the Insert parameter button. This allows you to insert parameters for duration—the number of hours [STEPS]—and for shares—the number of spots [P1].
Enter the formula. The discount of $20 is multiplied by the number of hours beyond two. Then, multiply the result by the number of reserved spots.
-20 * ([STEPS]-2) * [P1]
Next, click the Add condition button.
Set the minimum steps to 3. In this case, the discount will not apply to bookings of one or two periods. Save your changes.
Now, let's check the result. We'll book two spots for 5 hours.
-20 * (5-2) * 2 = $120.
You can also take the opposite approach. Add a surcharge of $20 per hour for bookings shorter than three hours. To do this, first set the hourly price to $80. Then, create a pricing component.
Enter a name for the component. Insert parameters for duration—the number of hours [STEPS]—and for shares—the number of spots [P1].
Enter the formula. The surcharge of $20 is multiplied by the number of hours. Then, multiply the result by the number of reserved spots.
20 * [STEPS] * [P1]
Next, click the Add condition button.
Set the maximum steps to 2. The surcharge will only apply to bookings of one or two periods. Save your changes.
Check the results. We'll book 3 spots for 2 hours.
20 * 2 * 3 = $120.
If you prefer not to split the cost into separate parts, you can calculate the total using a single pricing component. To do this, set the price of the price option to $0. Then, create the pricing component.
Enter a name for the component. Insert parameters for duration—the number of hours [STEPS]—and for shares—the number of spots [P1].
Enter the formula. Multiply $100 by the number of hours. Subtract the discount of $20 multiplied by the number of hours beyond two. Then, multiply the result by the number of reserved spots.
In the formula, use the Max function. This function returns the greater of two numbers. This ensures that the expression [STEPS]-2 cannot be less than zero. To add a function, click the Insert function button and select Max from the list.
(100 * [STEPS] - 20 * Max(0,[STEPS]-2)) * [P1]
Let's check the result. We'll reserve two spots for 4 hours.
(100 * 4 - 20 * (4-2)) * 2 = $720.
See this example in action: