WC_Shortcode_My_Account::view_order()
View order page.
Method of the class: WC_Shortcode_My_Account{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Shortcode_My_Account::view_order( $order_id );
- $order_id(int) (required)
- Order ID.
WC_Shortcode_My_Account::view_order() WC Shortcode My Account::view order code WC 9.5.1
public static function view_order( $order_id ) { $order = wc_get_order( $order_id ); if ( ! $order || ! current_user_can( 'view_order', $order_id ) ) { wc_print_notice( esc_html__( 'Invalid order.', 'woocommerce' ) . ' <a href="' . esc_url( wc_get_page_permalink( 'myaccount' ) ) . '" class="wc-forward">' . esc_html__( 'My account', 'woocommerce' ) . '</a>', 'error' ); 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(), ) ); }