A booking must be created before payment for several important reasons:
- Prevent Double Bookings: By creating the booking first, the system can immediately reserve the dates or times, preventing other visitors from booking the same slot until the payment is made. If the payment is not completed, the reserved dates or times will be released, making them available for other potential customers.
- Booking Identification: Creating the booking beforehand allows the system to generate a unique booking ID and capture other necessary details for managing the reservation and payment process effectively.
Customizing the Booking and Payment Process
Here are some options to manage the booking and payment notifications and approvals:
Disable Booking Notifications
To prevent visitors from receiving booking notifications before making a payment:
- Go to WP Booking Calendar > Settings > Emails page.
- Disable the "New booking (visitor)" email template. This ensures that the visitor will not receive a notification about the booking until the payment is made.
Automatic Booking Approval
To automatically approve bookings once the payment is made:
- Go to Booking > Settings > Payment page.
- In the Stripe or PayPal section, activate the "Automatically approve/cancel booking" option. This setting will automatically approve the booking and send a confirmation email to the visitor after the payment is successfully processed.
Auto-Cancel Pending Bookings
To automatically cancel pending bookings that are not paid after a specific period:
- Go to Booking > Settings General page.
- In the "Auto cancellation / approving" section, configure the settings to auto-cancel bookings that do not have a successfully paid status after a set time.
---
When Does Auto Cancellation Start Working?
Auto cancellation starts working when someone visits the front end of your website. It's important to ensure your timezone configuration is correct in the WordPress > Settings > General page, as incorrect time settings can cause issues with auto-cancellation.
How Auto Cancellation Works
Auto-cancellation can execute every hour (or another configured period) if you have set up a CRON job on your website, or if a visitor accesses your website and the cancellation time exceeds the specific auto-cancellation duration since the last cancellation.
- If no one visits your website within the configured period (e.g., one hour), the system will not initiate the script to check for auto-cancellations or other scheduled tasks.
- In this case, you need to configure a CRON job on your server. Learn more about configuring a CRON script.
Understanding WordPress Cron
WordPress Cron operates as a "pseudo-cron system," which works differently from a typical UNIX cron system.UNIX Cron:
- A scheduled time triggers an action.
- Cron executes the action tied to that time.
WordPress Cron:
- A visitor accesses any page on your WordPress website.
- WordPress Cron checks each cron event to see if the scheduled time has passed.
- If the scheduled time for an event has passed, WordPress Cron executes any actions tied to that event.
This system ensures that scheduled tasks, such as auto-cancellations, run when there's activity on your site, or through a configured server-side CRON job.