【问题标题】:WooCommerce Rest Api: Get the orders by specific dateWooCommerce Rest Api:按特定日期获取订单
【发布时间】:2016-10-23 22:21:05
【问题描述】:

我想使用 WooCommerce Rest Api 在特定日期获取订单。 Api 提供了只接受 ID 的订单方法。但我想在特定日期获得特定订单。

我怎样才能做到这一点?

谢谢。

【问题讨论】:

    标签: php wordpress woocommerce wordpress-rest-api


    【解决方案1】:

    为此,您需要查看 WooCommerce orders 端点。特别是围绕 afterbefore 过滤器。

    例如。

    GET wp-json/wc/v3/orders?after=2016-06-22T00:00:00&before=2016-06-22T23:59:59per_page=100

    【讨论】:

    • 难以置信! “T00:00:00”这个代码为我节省了很多时间!很棒
    • @Andrew A. Barber 如何为此类场景创建端点 URL?
    • 谢谢,这有帮助!虽然我想选择一个不同的日期进行比较,而不是date_created
    猜你喜欢
    • 2021-07-31
    • 2017-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 2019-07-08
    • 2016-05-10
    • 2012-09-01
    相关资源
    最近更新 更多