WordPress at Your Fingertips
function is not described

WC_Shortcode_My_Account::view_order() public WC 1.0

View order page.

{} It's a method of the class: WC_Shortcode_My_Account{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Shortcode_My_Account::view_order( $order_id );
$order_id(int) (required)
Order ID.

Code of WC_Shortcode_My_Account::view_order() WC 5.9.0

public static function view_order( $order_id ) {
	$order = wc_get_order( $order_id );

	if ( ! $order || ! current_user_can( 'view_order', $order_id ) ) {
		echo '<div class="woocommerce-error">' . esc_html__( 'Invalid order.', 'woocommerce' ) . ' <a href="' . esc_url( wc_get_page_permalink( 'myaccount' ) ) . '" class="wc-forward">' . esc_html__( 'My account', 'woocommerce' ) . '</a></div>';

		return;
	}

	// Backwards compatibility.
	$status       = new stdClass();
	$status->name = wc_get_order_status_name( $order->get_status() );

	wc_get_template(
		'myaccount/view-order.php',
		array(
			'status'   => $status, // @deprecated 2.2.
			'order'    => $order,
			'order_id' => $order->get_id(),
		)
	);
}