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

时间:2018-05-01 18:21:05

标签: php wordpress templates woocommerce wordpress-theming

我在WooCommerce购物车页面上显示空白时出现此错误,我该如何摆脱此错误消息?

  

致命错误:未捕获ArgumentCountError:参数太少   函数wc_get_page_id(),0传入   /家庭/ s3morder /的public_html /可湿性粉剂内容/主题/内联网   主题/ 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 /...&# 39;)#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行

提前致谢!

1 个答案:

答案 0 :(得分:0)

我发现在empty-cart.php中有一个额外的功能,我没有摆脱,一旦我缩小了错误的开始,我想出了我需要得到的东西除了之外,cart-empty.php文件如下所示。

<?php

   if ( ! defined( 'ABSPATH' ) ) {
      exit; // Exit if accessed directly
   }
?>
<div class="text-center">
   <?php do_action( 'woocommerce_cart_is_empty' );?>
</div>

给出的答案是Your cart is currently empty.这是完美的! 我希望这有助于某人!