Skip to content

Instantly share code, notes, and snippets.

@Frithir
Created July 13, 2015 01:15
Show Gist options
  • Save Frithir/8878639fb4cb092c4839 to your computer and use it in GitHub Desktop.
Save Frithir/8878639fb4cb092c4839 to your computer and use it in GitHub Desktop.
Woocommerce - Add cart number
<?php if (sizeof(WC()->cart->get_cart()) != 0): ?>
<?php global $woocommerce; echo $woocommerce->cart->cart_contents_count; ?>
<a href="<?php echo get_permalink(5); ?>">
<i class="fa fa-shopping-cart"></i> <?php global $woocommerce; echo $woocommerce->cart->cart_contents_count; ?> Cart
</a>
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment