How to display number of items

Using the next code a theme constructor/designer could display in the header the number of items in the cart and links to the shopping cart and to the checkout.

This type of information is very useful in any ecommerce site. TheCartPress supports a variety of widgets and shortcodes to display this type of information, but theme developers usually prefers to add it to theirs own themes using template functions.

Edit header.php file, of your theme, adding next code:

$shoppingCart = TheCartPress::getShoppingCart();
printf( '%s item(s) in your <a href="%s">bag</a> – <a href="%s">Checkout</a>', $shoppingCart->getCount(), tcp_get_the_shopping_cart_url(), tcp_get_the_checkout_url() );

You have to see something like this:

Functions used: