Plugins 对第790行config woocommerce/config.php中的非对象调用成员函数get\u cart\u subtotal()
我正在尝试登录我的WordPress管理面板,出现以下错误: 在第790行的/home/spicom/public\u html/adwinang.com/wp-content/themes/enfold/config-woocommerce/config.php中对非对象调用成员函数 这是我在第790行的代码:Plugins 对第790行config woocommerce/config.php中的非对象调用成员函数get\u cart\u subtotal(),plugins,wordpress,woocommerce,wordpress-theming,Plugins,Wordpress,Woocommerce,Wordpress Theming,我正在尝试登录我的WordPress管理面板,出现以下错误: 在第790行的/home/spicom/public\u html/adwinang.com/wp-content/themes/enfold/config-woocommerce/config.php中对非对象调用成员函数 这是我在第790行的代码: $cart_subtotal = $woocommerce->cart->get_cart_subtotal(); 听起来你好像还没有打电话给环球商务,然后再尝试访问$w
$cart_subtotal = $woocommerce->cart->get_cart_subtotal();
听起来你好像还没有打电话给环球商务代码>,然后再尝试访问
$woocommerce
对象
更好的方法是使用WC()
:
或者,WooCommerce可能还没有安装和激活……如果它是主题依赖项,请确保这样做 我有一个非常相似的信息
[25-Sep-2018 10:24:08 UTC] PHP Fatal error: Uncaught Error:
Call to a member function get_cart_subtotal() on null in
themes\storefront\inc\woocommerce\storefront-woocommerce-template-functions.php:80
这是因为我的wp-config.php文件中包含以下内容
定义('DOING_CRON',false)
我在W3 Total Cache激活的情况下尝试从命令行运行某些东西时添加了这一行。我没有意识到这会彻底毁掉WooCommerce,也没有注意到它的副作用,直到我尝试在浏览器中查看该网站 查看我的更新。您是否安装并激活了WooCommerce?是的,我也安装并激活了它。。。。该网站运行良好…只是无法进入WP管理区。。这是我的网站
[25-Sep-2018 10:24:08 UTC] PHP Fatal error: Uncaught Error:
Call to a member function get_cart_subtotal() on null in
themes\storefront\inc\woocommerce\storefront-woocommerce-template-functions.php:80