function wspsc_compact_cart_handler($args)
{
    $num_items = wpspc_get_total_cart_qty();
    $curSymbol = get_option('cart_currency_symbol');
    $checkout_url = get_option('cart_checkout_page_url');
    $output = "";
    $output .= '<div class="wpsps_compact_cart wpsps-cart-wrapper">';
    $output .= '<div class="wpsps_compact_cart_container">';
    if ($num_items > 0) {
        $cart_total = wpspc_get_total_cart_sub_total();
        $item_message = $num_items == 1 ? "Item" : "Items";
        $output .= $num_items . " " . $item_message;
        $output .= '<span class="wpsps_compact_cart_price"> ' . print_payment_currency($cart_total, $curSymbol) . '</span>';
        if (!empty($checkout_url)) {
            $output .= '<a class="wpsps_compact_cart_co_btn" href="' . $checkout_url . '">' . __("View Cart", "wordpress-simple-paypal-shopping-cart") . '</a>';
        }
    } else {
        $cart_total = 0;
        $output .= __("Cart is empty", "wordpress-simple-paypal-shopping-cart");
        $output .= '<span class="wpsps_compact_cart_price"> ' . print_payment_currency($cart_total, $curSymbol) . '</span>';
    }
    $output .= '</div>';
    $output .= '</div>';
    return $output;
}
Example #2
0
responsive_in_header();
// header hook
?>
		
		
		

		<?php 
if (get_header_image() != '') {
    ?>
		

			<div id="logo">
			
				<?php 
    $cart_total = wpspc_get_total_cart_qty();
    ?>
				<?php 
    if ($cart_total > 1) {
        ?>
					<span class="cart-total"><?php 
        echo $cart_total;
        ?>
 items in cart.</span>
				<?php 
    } else {
        if ($cart_total == 1) {
            ?>
					<span class="cart-total"><?php 
            echo $cart_total . " item in cart.";
            ?>