PHP Fatal Error
-
My error_log is quite big (2GB) and I get the following error a few times a day:
Fatal error: Call to a member function get_cart_subtotal() on null in /home/abc/www.link.to/wp-content/themes/storefront/inc/woocommerce/storefront-woocommerce-template-functions.php on line 77
Line 73-81 of the storefront-woocommerce-template-functions.php file:
function storefront_cart_link() { ?> <a class="cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'storefront' ); ?>"> <?php /* translators: %d: number of items in cart */ ?> <?php echo wp_kses_post( WC()->cart->get_cart_subtotal() ); ?> <span class="count"><?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'storefront' ), WC()->cart->get_cart_contents_count() ) ); ?></span> </a> <?php } }
Any idea what could cause the error?
Wordpress, Woocommerce, Storefront is up to date.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP Fatal Error’ is closed to new replies.