Trustpilot | Site Banner Q4 2026

Banner image
Product Icon

WooCommerce Bookings

WooCommerce Bookings is the official WooCommerce extension that lets store owners sell appointments, reservations, rentals, or classes with bookable time or date slots. It supports fixed time slots or flexible ranges, group and individual pricing, and resources — staff, rooms, or equipment — each with its own availability to prevent double-booking. It syncs with Google Calendar and works with any WooCommerce payment gateway. It's a paid annual extension with a 30-day money-back guarantee.

Replace hard-coded status check with $order->needs_payment()

The “pay” button in My Account > Orders is disabled by checking if the order has the status “pending”. This works fine for default Woo behaviour but excludes custom order statuses.

Instead, check if the order needs payment with $order->needs_payment() which returns boolean true/false. The function contains a filter that allows 3rd party plugins to add their own unpaid order statuses with filter “woocommerce_valid_order_statuses_for_payment”.

Use case: 3rd party plugin adds an unpaid order status. With the modification the 3rd party plugin does not need to add further code to remove the Pay button.

Benefit: better integration with 3rd party plugins

Screenshots

Author

devagenturallison

Current Status

Open

Last updated: July 10, 2024

0 comments

Log in to comment on this feature request.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.