<!--start header-cart-->
<div id=""><a href="http://example.com/products-page/checkout/">
<!-- name the class anything you like --> <span class="ge-count">
<? if (function_exists('wpsc_cart_item_count')) { // checks to see if this function exists
if (wpsc_cart_item_count() == 0 || isset($_GET['sessionid'])) { // checks if count is zero or sessionid is set
echo "Shopping cart is empty";
}
elseif (wpsc_cart_item_count() == 1 || isset($_GET['sessionid'])) { // checks if count is one or sessionid is set
echo wpsc_cart_item_count(); // this is the function that checks the item count in your cart
?>
item in cart
<?
} else
{
echo wpsc_cart_item_count();
?>
items in cart
<? }
} ?>
</span></a>
</div><!--close header-cart-->
在WP电子商务中创建一个标题迷你购物车-第2部分
CREATE A HEADER MINI-CART IN WP E-COMMERCE - Part 2