The website rents out rooms by the hour.
I use the "WooCommerce Bookings And Appointments" plugin on my website. The plugin URL is https://www.pluginhive.com/product/woocommerce-booking-and-appointments/
The plugin supports cost rules and I can control the price at all times. But I can't find a solution for my specific scenario.
If the customer selects a time between 10pm and 10am.
And minimumorder timeis greater than 6 hours.
Then the price will be 6 hours.
Booking period is set in the general settings, 30 minutes per period.
Booking fee settings: 3 hours Minimum price is $300 (we use rules from blocks 1 to 6).
Base room rate: $300 (customers can order less than 3 hours, but the price is a minimum of 3 hours).
Block Cost: $50 (starting with block number 7).
Scenario example:
If a customer orders 4 hours from 11pm to 3am (total blocks: 8), the price will be regular price: $400 (base cost: 300$100 [2 blocks, $50 each])
If a customer orders 5 hours from 11pm to 4am (total blocks: 10), the price will be the regular price: $500
If a customer orders 6 hours from 11pm to 5am (total blocks: 12), the price will be the regular price: $600
If a customer orders 7 hours from 11pm to 6am (total blocks: 14), the price will be $600 instead of $700
If a customer orders 8 hours from 11pm to 7am (total blocks: 16), the price will be $600 instead of $800
If the customer orders 6 hours from 9pm to 3am (total blocks: 12), the price will be $600
If a customer orders 9 PM to 4 AM 7 hours (total blocks: 14), the price will be $600 instead of $700
If a customer orders 9 PM to 5 AM 8 hours (total blocks: 16), the price will be $600 instead of $800
If a customer orders within the 14 hours 9pm to 11am (Total blocks: 28), the price will be $800 instead of $1400
I tried following this article to set prices based on WooCommerce Bookings duration and making adjustments to my question, but with no success.
I created the code snippet but don't see any changes. Check this Link to the live preview