Apologies, PHP is not my strongest area so this might seem super easy to others.
I am trying to implement a statement to say, when there is something in my WooCommerce Cart to show the cart. If there's nothing in the cart then show nothing.
The code I have so far is:
<?php if ( sizeof( $woocommerce->cart->cart_contents ) == 0 ) {
// The cart is empty
} else {
<div class="header-cart-inner">
<a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
</div>
} ?>
The code doesn't work and keeps giving me syntax errors.