WC_Order::needs_payment()publicWC 1.0

Checks if an order needs payment, based on status and order total.

{} Это метод класса: WC_Order{}

Возвращает

true|false.

Использование

$WC_Order = new WC_Order();
$WC_Order->needs_payment();

Код WC_Order::needs_payment() WC 6.9.1

public function needs_payment() {
	$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $this );
	return apply_filters( 'woocommerce_order_needs_payment', ( $this->has_status( $valid_order_statuses ) && $this->get_total() > 0 ), $this, $valid_order_statuses );
}