How to get cart total in woocommerce

,



New Code 

<a class="" 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>

output 



Old Code


Here is the code



<?php 
 global $woocommerce; 
 echo get_woocommerce_currency_symbol().'&nbsp;'.$woocommerce->cart->total; 
?>

get_woocommerce_currency_symbol() - return the currency code

$woocommerce->cart->total - return cart total



Related Post


Latest Post


Recent Posts Widget

Make sure to never miss a thing...

Get the latest news from the creative industry along with other creative goodies, conveniently delivered to social media.