簡體   English   中英

woocommerce REST API中的日期

[英]date in woocommerce REST API

嗨,我想在儀表板上創建一個過濾器,以獲取今天的訂單並按日期過濾

$results  = $woocommerce->get('orders');

<div id="blog-overview-date-range" class="input-daterange input-group input-group-sm my-auto ml-auto mr-auto ml-sm-auto mr-sm-0" style="max-width: 350px;">
                          <input type="text" class="input-sm form-control" name="start" placeholder="Start Date" id="blog-overview-date-range-1">
                          <input type="text" class="input-sm form-control" name="end" placeholder="End Date" id="blog-overview-date-range-2">
                          <span class="input-group-append">
                            <span class="input-group-text">
                              <i class="material-icons"></i>
                            </span>
                          </span>
                        </div>

謝謝

$from = 2018-08-01;
$to   = 2018-08-09; 
$parameters = array(
             'after'  =>$from,
             'before' => $to
              );
$woocommerce->get('orders', $parameters);

要獲取特定日期之間的訂單列表,可以按照文檔中所述,在符合ISO8601的日期中使用參數前后。 閱讀文檔以獲取更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM