【发布时间】:2018-10-11 19:11:59
【问题描述】:
我的 WooCommerce 购物车页面为空时出现此错误,我该如何消除此错误消息?
致命错误:未捕获的 ArgumentCountError:参数太少 函数 wc_get_page_id(), 0 传入 /home/s3morder/public_html/wp-content/themes/Intranet Theme/woocommerce/cart/cart-empty.php 在第 30 行,正好是 1 预计在 /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/wc-page-functions.php:45 堆栈跟踪:#0 /home/s3morder/public_html/wp-content/themes/Intranet 主题/woocommerce/cart/cart-empty.php(30): wc_get_page_id() #1 /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(211): 包括('/home/s3morder/...')#2 /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-cart.php(85): wc_get_template('cart/cart-empty...') #3 /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(76): WC_Shortcode_Cart::output(Array) #4 /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(89): WC_Shortcodes::shortcode_wrapper(Array) #5 /home/s3morder/public_html/wp- in /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/wc-page-functions.php 在第 45 行
提前致谢!
【问题讨论】:
-
您是否修改了购物车代码?该错误仅表明函数 wc_get_page_id() 调用了 0 个参数,但需要 1 个参数
-
如果不是,请在第 30 行向我们展示来自 /Intranet Theme/woocommerce/cart/cart-empty.php 的代码(向我们展示超过第 30 行)
-
所以模板文件
cart/cart-empty.php位于你的"Intranet Theme"主题文件夹是有罪的,你应该联系主题作者支持线程,因为我们不处理 StackOverFlow 中的支持 -
感谢@LoicTheAztec 的帮助,我弄清楚了它是什么并让它正常工作。
-
感谢@Tobias 的帮助。
标签: php wordpress templates woocommerce wordpress-theming