Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
AbstractOrderConfirmationBlock::get_order
Get current order.
Method of the class: AbstractOrderConfirmationBlock{}
No Hooks.
Returns
\WC_Order|null.
Usage
// protected - for code of main (parent) or child class $result = $this->get_order();
AbstractOrderConfirmationBlock::get_order() AbstractOrderConfirmationBlock::get order code WC 10.5.0
protected function get_order() {
$order_id = absint( get_query_var( 'order-received' ) );
if ( $order_id ) {
return wc_get_order( $order_id );
}
return null;
}