-1, 'orderby' => 'date', 'order' => 'DESC', 'status' => array('processing', 'completed', 'on-hold', 'in_transit', 'delivered') )); $orders = $orders_query->get_orders(); // 获取运单信息 global $wpdb; $shipments = array(); $shipment_results = $wpdb->get_results(" SELECT order_id, tracking_number, czl_order_id, reference_number, status as shipment_status, label_url FROM {$wpdb->prefix}czl_shipments "); foreach ($shipment_results as $shipment) { $shipments[$shipment->order_id] = $shipment; } // 添加必要的JavaScript变量 wp_enqueue_script('jquery'); ?>
' . __('没有找到订单', 'woo-czl-express') . ' | '; } else { foreach ($orders as $order): $order_id = $order->get_id(); $shipment = isset($shipments[$order_id]) ? $shipments[$order_id] : null; // 获取配送方式 $shipping_methods = $order->get_shipping_methods(); $shipping_method = current($shipping_methods); $shipping_method_title = $shipping_method ? $shipping_method->get_method_title() : ''; ?>|||||||
#get_order_number()); ?> | get_date_created())); ?> | get_status()); $status_class = sanitize_html_class('status-' . $order->get_status()); echo "" . esc_html($status_name) . ""; ?> |
get_formatted_shipping_full_name()); ?> get_shipping_address_1()); ?> get_shipping_city() . ', ' . $order->get_shipping_country()); ?> |
tracking_number)): ?>
tracking_number); ?>
czl_order_id); ?> reference_number); ?> shipment_status); ?> |
tracking_number)): ?> czl_order_id)): ?> |