Home Forums WoodMart support forum Technical problem message from WordPress Reply To: Technical problem message from WordPress

#311087

Artem Temos
Keymaster

Hello,

This error will be fixed in our next theme update. You can fix it now by adding the following code to the functions.php file in the child theme

function woodmart_cart_count() {
		if ( ! is_object( WC() ) || ! property_exists( WC(), 'cart' ) ) {
			return;
		}
		$count = WC()->cart->get_cart_contents_count();
		?>
			<span class="wd-cart-number<?php echo woodmart_get_old_classes( ' woodmart-cart-number' ); ?>"><?php echo esc_html( $count ); ?> <span><?php echo esc_html( _n( 'item', 'items', $count, 'woodmart' ) ); ?></span></span>
		<?php
	}

Kind Regards