Automattic\WooCommerce\Internal\Admin
OrderMilestoneEasterEgg::is_qualifying_order
Returns true if the given order qualifies for milestone consideration: status is processing or completed, and a transaction ID is present.
Used as a cheap pre-filter before running the full milestone count query.
Method of the class: OrderMilestoneEasterEgg{}
No Hooks.
Returns
true|false.
Usage
$OrderMilestoneEasterEgg = new OrderMilestoneEasterEgg(); $OrderMilestoneEasterEgg->is_qualifying_order( $order_id ): bool;
- $order_id(int) (required)
- The order ID to check.
OrderMilestoneEasterEgg::is_qualifying_order() OrderMilestoneEasterEgg::is qualifying order code WC 10.9.1
public function is_qualifying_order( int $order_id ): bool {
$order = wc_get_order( $order_id );
if ( ! $order instanceof \WC_Order ) {
return false;
}
return '' !== $order->get_transaction_id()
&& in_array( $order->get_status(), array( 'processing', 'completed' ), true );
}