我正在为 woocommerce 制作自定义报告,我正在尝试为所有已交付的订单添加报告,这就是我在做什么
$orders = wc_get_orders( array('numberposts' => -1) );
foreach( $orders as $order ){
if ( $order->get_status() === completed){
$order_data = $order->get_data(); // The Order data
$items = $order->get_items();
foreach ( $items as $item ) {
$product_name = $item->get_name();
$product_id = $item->get_product_id();
}
$orders_completed .= '<tr><td>' . $order->get_order_number() . '</td>' .
'<td>' . $order->get_date_created()->date('Y-m-d H:i:s') . '</td>' .
'<td>' . $order->get_status() . '</td>' .
'<td>' . $order->get_total() . '</td>' .
'<td>' . $product_id . '</td>' .
'<td>' . $product_name . '</td>' .
'<td>' . $order->get_item_count() . '</td>' .
'<td>' . $order->get_billing_first_name() . '</td>' .
'<td>' . $order->get_billing_email() . '</td>' .
'<td>' . $order->get_billing_phone() . '</td>' .
'<td>' . $order_payment_method = $order_data['payment_method_title'] . '</td></tr>';
}
}
我明白了
调用未定义的方法 WC_Admin_Order_Refund::get_order_number()
我不知道我做错了什么
吃鸡游戏