Skip to content

Instantly share code, notes, and snippets.

@braddalton
Forked from mikejolley/gist:2044101
Created December 5, 2016 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/e1e1e69ceea697fb20fcc6fb3b4e216a to your computer and use it in GitHub Desktop.
Save braddalton/e1e1e69ceea697fb20fcc6fb3b4e216a to your computer and use it in GitHub Desktop.
WooCommerce - Show number of items in cart and total
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment