Instantly share code, notes, and snippets.

Embed
What would you like to do?
Only display cart link if cart has items
<?php if (sizeof(WC()->cart->get_cart()) != 0) : ?>
<a href="<?php echo WC()->cart->get_cart_url(); ?>">
<span class="cart_totals"><?php echo WC()->cart->get_cart_total(); ?></span>
</a>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment