似乎无法让分页在我的 WooCommerce REST API 应用程序上运行?
到目前为止我得到了什么:
[
'wp_api' => true,
'version' => 'wc/v3',
'query_string_auth' => true //Force Basic Authentication as query string true and using under HTTPS
]
);
try {
$results = $woocommerce->get('orders?per_page=30');
$result = count($results);
我尝试删除 query_string_auth 但没有显示任何数据。 仅供参考,它可以在 page=30 的情况下工作,但只显示前 10 项。
任何建议都会有很大帮助:
What I got so far:
[
'wp_api' => true,
'version' => 'wc/v3',
'query_string_auth' => true //Force Basic Authentication as query string true and using under HTTPS
]
);
try {
$results = $woocommerce->get('orders?per_page=30');
$result = count($results);
I tried to remove the query_string_auth but I dont get any data displayed.
FYI it works without the page=30 but then only displayed the first 10 items.
Any advice would help alot:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
获取方法接受额外的参数。
尝试这样的
更多详细信息可以看到在这里
Get method accepts extra parameters.
Try like this
More details can be seen here
如果您使用 Nginx,请检查您的 Nginx 配置。缺少 Nginx 设置将忽略 GET 方法查询参数。因此,问题可能在于您的 page 或 per_page 参数被忽略。
If you are using Nginx, check your Nginx configurations. Missing Nginx settings will ignore the GET method query parameters. So it might be the issue that your page or per_page parameter are simply being ignored.