Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

AbstractOrderConfirmationBlock::get_order()protectedWC 1.0

Get current order.

Метод класса: AbstractOrderConfirmationBlock{}

Хуков нет.

Возвращает

\WC_Order|null.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_order();

Код AbstractOrderConfirmationBlock::get_order() WC 9.6.1

protected function get_order() {
	$order_id = absint( get_query_var( 'order-received' ) );

	if ( $order_id ) {
		return wc_get_order( $order_id );
	}

	return null;
}