【发布时间】:2018-07-03 10:56:59
【问题描述】:
对于 Woocommerce,我在下面编写了代码,试图获取今天的订单总购买量:
function order_total_woo_fahad(){
// Get orders from people named John that were paid in the year 2016.
$orders = wc_get_orders( array(
'date_paid' => '2018-07-03'
) );
$total_of_all=0;
for($i=0;$orders[i];$i++)
$total_of_all= $orders[i]->get_total();
return $total_of_all;
}
但它返回 null。
我做错了什么?如何获取当天的订单总购买金额?
【问题讨论】:
标签: php sql wordpress woocommerce orders