我们的一个Wordpress网站正面临 WooCommerce WooCommerce 的问题 . 单击"Place Order"按钮时会触发错误:
SyntaxError: Unexpected token < in JSON at position 0
这是控制台中显示的错误:
<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>
-
我已禁用除WooCommerce之外的所有插件,问题仍然存在;
-
我尝试过像TwentyThirteen这样的默认主题,问题仍然存在;
-
WooCommerce是最新的(版本3.2.3);
-
我们有COD(货到付款)和银行转账作为付款选项 .
有什么想法吗?
2 回答
在调试代码之后,我发现我的问题出在数据库的某个地方,并且订单的ID没有正确保存(传递的值始终为0) . 我的猜测是一些插件搞砸了我的数据库 .
auto-increment was off in my database ,因此无法正确保存订单的ID,从而导致第1篇文章中提到的上述错误 .
解决方案是 fix the database ,在需要的地方添加 auto-increment 并删除表 wp_posts 中所有0作为ID的条目 .
我遇到了同样的问题,它解决了文件夹权限问题 .