shortcode_wrapper( array( __CLASS__, 'output' ), $atts ); } /** * Output the shortcode. * * @access public * @param array $atts * @return void */ public static function output( $atts ) { global $woocommerce; $woocommerce->nocache(); if ( ! is_user_logged_in() ) return; $user_id = get_current_user_id(); $order_id = ( isset( $_GET['order'] ) ) ? $_GET['order'] : 0; $order = new WC_Order( $order_id ); if ( $order_id == 0 ) { woocommerce_get_template('myaccount/my-orders.php', array( 'order_count' => 10 )); return; } if ( $order->user_id != $user_id ) { echo '
' . __( 'Invalid order.', 'woocommerce' ) . ' '. __( 'My Account →', 'woocommerce' ) .'' . '
'; return; } $status = get_term_by('slug', $order->status, 'shop_order_status'); echo '

' . sprintf( __( 'Order %s made on %s', 'woocommerce'), $order->get_order_number(), date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ) ) . '. ' . sprintf( __( 'Order status: %s', 'woocommerce' ), __( $status->name, 'woocommerce' ) ) . '.

'; $notes = $order->get_customer_order_notes(); if ($notes) : ?>

  1. comment_date)); ?>

    comment_content)); ?>