1
주문 목록이있는 템플릿을 만들고 billing_first_name별로 정렬하고 싶습니다. 어레이에서 명령을 시도했지만 성공하지 못했습니다.Woocommerce - 페이지 템플릿 - 주문 : billing_first_name
<?php
global $woocommerce;
$args = array(
'post_type' => 'shop_order',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'shop_order_status',
'field' => 'slug',
'terms' => array('processing', 'on-hold', 'pending', 'completed', 'cancelled', 'refunded', 'failed')
)
)
);
$loop = new WP_Query($args);
?>
<article id="tabela_inscricoes">
<div id="title_lista_inscritos">Order list</div>
<table cellspacing="0" cellpadding="2">
<tbody>
<?php
while ($loop->have_posts()) : $loop->the_post();
$order_id = $loop->post->ID;
$order = new WC_Order($order_id);
?>
<tr>
<td style="text-align:left;"><?php echo $order->billing_first_name; ?> <?php echo $order->billing_last_name; ?></td>
<td style="text-align:left;"><?php echo $order->billing_company; ?></td>
<td style="text-align:left;"><?php echo custom_status($order); ?></td>
</tr>
</tbody>
</table>
</article>
이 문제를 어떻게 해결할 수 있습니까?
감사