Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

AbstractOrderConfirmationBlock::get_order()protectedWC 1.0

Get current order.

Method of the class: AbstractOrderConfirmationBlock{}

No Hooks.

Return

\WC_Order|null.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_order();

AbstractOrderConfirmationBlock::get_order() code WC 9.6.0

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

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

	return null;
}