Reputation: 49
Im getting this error on my WooCommerce Cart Page when it is empty, how would I get rid of this error message?
Fatal error: Uncaught ArgumentCountError: Too few arguments to function wc_get_page_id(), 0 passed in /home/s3morder/public_html/wp-content/themes/Intranet Theme/woocommerce/cart/cart-empty.php on line 30 and exactly 1 expected in /home/s3morder/public_html/wp-content/plugins/woocommerce/includes/wc-page-functions.php:45 Stack trace: #0 /home/s3morder/public_html/wp-content/themes/Intranet Theme/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('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 on line 45
Thanks in advance!
Upvotes: 1
Views: 2695
Reputation: 49
I found that there was an extra function in the empty-cart.php that I hadn't gotten rid of, once I narrowed down where the error's started, I figured out what I needed to get rid of, the cart-empty.php file is as is below.
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="text-center">
<?php do_action( 'woocommerce_cart_is_empty' );?>
</div>
And the response given is Your cart is currently empty.
Which is perfect!
I hope this helps someone!
Upvotes: 0