gpt4 book ai didi

WooCommerce API only returns 5 orders(WooCommerce API仅退回5个订单)

转载 作者:bug小助手 更新时间:2023-10-24 23:15:39 33 4
gpt4 key购买 nike



I am trying to query my shop to debug why my 3rd party integration won't sync orders. I do that by sending a GET request to https://myshop.com/wp-json/wc/v3/orders?per_page=10. I get a total of 5 orders and these headers:

我正在尝试询问我的商店以调试为什么我的第三方集成不能同步订单。为此,我向https://myshop.com/wp-json/wc/v3/orders?per_page=10.发送GET请求,总共收到5个订单和以下标头:


X-WP-Total: 5
X-WP-TotalPages: 1

So in other words, 5 orders total and only 1 page. If I add &page=2 I get an empty array.

换句话说,总共有5个订单,但只有1页。如果我加上&page=2,我会得到一个空数组。


I am really unsure why this is happening and not really sure where to start debugging. I have more than 5 orders.

我真的不确定为什么会发生这种情况,也不确定从哪里开始调试。我有5个以上的订单。


EDIT: When I try to edit one of the 5 orders, I see it update perfectly in the response as well. If I update a product, requesting /products also returns the new products. The orders API is messed up, somehow.

编辑:当我尝试编辑5个订单中的一个订单时,我也看到它在响应中完美更新。如果我更新产品,则请求/Products也会返回新产品。Orders API不知何故搞砸了。


更多回答
优秀答案推荐

I manged to "fix" it by turning on "High performance order storage" in WooCommerce. No clue why it stopped working and suddenly works.

我试图通过打开WooCommerce中的“高性能订单存储”来“修复”它。不知道为什么它停止工作,然后突然起作用。


enter image description here


更多回答

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com