Capture amount of Items in WordPress Cart

3

I would like to know the best way to capture the amount of items in the Woocommerce carton in Wordpress, if there is any shortcode, etc.

    
asked by anonymous 20.02.2015 / 19:58

1 answer

2

To show in your template the total use this:

<?php 

    global $woocommerce;
    $numero = sprintf(_n('%d', $woocommerce->cart->cart_contents_count, 'woothemes'));

    echo $numero;

?>
    
24.02.2015 / 17:28