未捕获的ArgumentCountError(函数wc_get_page_id()的参数太少)

我在WooCommerce购物车页面上为空时收到此错误, 我如何摆脱此错误消息?

致命错误:未捕获ArgumentCountError:函数wc_get_page_id()的参数太少, 第30行的/ home / s3morder / public_html / wp-content / themes / Intranet Theme / woocommerce / cart / cart-empty.php中传递了0。在/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):include(‘ / home / s3morder / … ’ )#2 /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-cart.php(85):wc_get_template(‘ 购物车/购物车为空。 ..’ )#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(Arr ay)在第45行的/home/s3morder/public_html/wp-content/plugins/woocommerce/includes/wc-page-functions.php中#5 / home / s3morder / public_html / wp-
提前致谢!
#1我发现在empty-cart.php中还有一个我没有摆脱的额外功能, 一旦我缩小了错误开始的地方, 我就知道需要摆脱的东西是cart-empty.php。文件如下。
< ?phpif ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } ?> < div class="text-center"> < ?php do_action( 'woocommerce_cart_is_empty' ); ?> < /div>

【未捕获的ArgumentCountError(函数wc_get_page_id()的参数太少)】给出的响应是你的购物车当前为空。哪一个完美!我希望这可以帮助别人!

    推荐阅读