UPS Promotional Credit Campaign Aug ’25 – Banner

Banner promoting UPS Promotional Credit Campaign on UPS x Woo Landing page

Afterpay | Site Banner Q3 2025

added Latoya

Product Icon

WooCommerce Bookings

Allow customers to book appointments, make reservations or rent equipment without leaving your site.

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.