Skip to content

Instantly share code, notes, and snippets.

@ajithrn
Forked from mikejolley/gist:2044101
Last active August 29, 2015 14:18
Show Gist options
  • Save ajithrn/3c42c17cd227d3a0bf8d to your computer and use it in GitHub Desktop.
Save ajithrn/3c42c17cd227d3a0bf8d to your computer and use it in GitHub Desktop.
Wordpress: Woocommerce items in cart and total
/**
* items to display total number of items and cost
* ref: https://gist.github.com/mikejolley/2044101
*/
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment