Wordpress WooCommerce Checkout - SyntaxError: Unexpected token < in JSON at position 0
Wordpress WooCommerce Checkout - SyntaxError: Unexpected token < in JSON at position 0
我们的一个 Wordpress 网站在 WooCommerce 的结帐页面 上遇到问题。单击 "Place Order" 按钮时会触发错误:
SyntaxError: Unexpected token < in JSON at position 0
这是控制台中显示的错误:
<br />
<b>Fatal error</b>: Call to a member function update_status() on
boolean in <b>/home/public_html/wp-
content/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-
bacs.php</b> on line <b>346</b><br />
- 我已禁用除 WooCommerce 之外的所有插件,但问题仍然存在;
- 我试过像 TwentyThirteen 这样的默认主题,但问题仍然存在;
- WooCommerce 是最新的(版本 3.2.3);
- 我们有 COD(货到付款)和银行转账两种付款方式。
有什么想法吗?
调试代码后,我发现我的问题出在数据库的某个地方,订单ID没有正确保存(传递的值始终为0)。我的猜测是某些插件搞砸了我的数据库。
我的数据库关闭了自增功能,所以无法正确保存订单ID,所以出现了第一个[=25]中提到的错误=].
解决方案是修复数据库,方法是在需要的地方添加自动增量,并删除所有带有 0 的条目ID在tablewp_posts.
我遇到了同样的问题,解决了文件夹权限问题。
我们的一个 Wordpress 网站在 WooCommerce 的结帐页面 上遇到问题。单击 "Place Order" 按钮时会触发错误:
SyntaxError: Unexpected token < in JSON at position 0
这是控制台中显示的错误:
<br />
<b>Fatal error</b>: Call to a member function update_status() on
boolean in <b>/home/public_html/wp-
content/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-
bacs.php</b> on line <b>346</b><br />
- 我已禁用除 WooCommerce 之外的所有插件,但问题仍然存在;
- 我试过像 TwentyThirteen 这样的默认主题,但问题仍然存在;
- WooCommerce 是最新的(版本 3.2.3);
- 我们有 COD(货到付款)和银行转账两种付款方式。
有什么想法吗?
调试代码后,我发现我的问题出在数据库的某个地方,订单ID没有正确保存(传递的值始终为0)。我的猜测是某些插件搞砸了我的数据库。
我的数据库关闭了自增功能,所以无法正确保存订单ID,所以出现了第一个[=25]中提到的错误=].
解决方案是修复数据库,方法是在需要的地方添加自动增量,并删除所有带有 0 的条目ID在tablewp_posts.
我遇到了同样的问题,解决了文件夹权限问题。