/** * @snippet Orders History @ WooCommerce Single Order Admin Page * @how-to businessbloomer.com/woocommerce-customization * @author Rodolfo Melogli, Business Bloomer * @compatible WooCommerce 9 * @community https://businessbloomer.com/club/ */ add_action( 'add_meta_boxes', function() { add_meta_box( 'order_history', 'Customer Order History', 'bbloomer_display_order_history', 'shop_order', 'normal', 'default' ); }, 1 ); function bbloomer_display_order_history() { global $post; $order = wc_get_order( $post->ID ); if ( ! $order ) return; $orders = array(); if ( $id = $order->get_customer_id() ) { $orders = wc_get_orders( [ 'customer_id' => $id, 'return' => 'ids', 'limit' => 10 ] ); } if ( ! $orders ) return; echo ''; foreach ( $orders as $order_id ) { $order = wc_get_order( $order_id ); if ( ! $order ) continue; $items = array(); foreach ( $order->get_items() as $item_id => $item ) { $items[] = $item->get_name(); } echo ''; } echo '
IDDATEITEMSSTATUS
' . $order_id . '' . wc_format_datetime( $order->get_date_created() ) . '' . implode( ' | ', $items ) . '' . $order->get_status() . '
'; }

Call Us: (724) 449-8416

Text Us at: (412) 618-0063

You've Got a Friend in the Business

Our Contact Information

LocationGibsonia, PA 15044
Phone724-449-8416
E-Mailsupport@designerdc.com
FaceBook FaceBook
 

Contact Us

*Required fields

Receive a Reply by:
Service by Biz Text