shopp_cart_items_count()

Get count of items in the cart

shopp_cart_items_count()

@return int number of items in the cart

Description

Get count of items in the cart. The “count of items” here refers specifically to the number of different line items present in the cart. This is not to be confused with the total quantity of items in the cart.

Example

<ul>
<?php 
// loop through each item in the cart
for( $i = 0; $i < shopp_cart_items_count(); $i++) {
    $item = shopp_cart_item($i); 
    ?><li><?php shopp($item,'name'); ?></li>
<?php endfor; 
?></ul>

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar