Extend WooCommerce Bookings’ Google Calendar integration to include bookings when they enter the Unpaid status. By default, Bookings syncs bookings when they enter Confirmed, Paid, or Complete.
Note:
This is a Developer level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customizations. We are unable to provide support for customizations under our Support Policy.
Before you begin
↑ Back to topConnect WooCommerce Bookings to a Google Calendar and test this customization on a staging site. This filter changes which booking statuses the calendar integration treats as eligible for synchronization; it does not record a payment or change the booking’s status. Events can contain booking and customer information, so limit access to the connected calendar.
Include unpaid bookings
↑ Back to topAdd this code to a custom plugin or your child theme’s functions.php file:
/**
* Allow unpaid bookings to sync to Google Calendar.
*
* @param string[] $statuses Booking statuses eligible for calendar sync.
* @return string[]
*/
function example_sync_unpaid_bookings_to_google( $statuses ) {
$statuses[] = 'unpaid';
return array_unique( $statuses );
}
add_filter( 'woocommerce_booking_is_paid_statuses', 'example_sync_unpaid_bookings_to_google' );
With the snippet active, create a test booking that enters Unpaid status and confirm that its event appears on the connected calendar. Review the event’s details and test the booking workflow before using this on a live store. This snippet does not perform a bulk sync of existing bookings.
Questions and support
↑ Back to topSomething missing from this documentation? Still have questions and need assistance?
- If you have a question about a specific extension or theme you’d like to purchase, contact us to get answers.
- If you already purchased this product and need some assistance, get in touch with a Happiness Engineer via our support page and select this product’s name from the Product dropdown.