Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php /* Use this code anywhere in your theme's PHP file(s) to display a shopping cart link with number of items in the cart*/ ?>
- <?php if (class_exists('wpCheckout')) { $wpCheckout = new wpCheckout(); }; ?>
- <?php global $wpcoHtml, $Item, $Order; ?>
- <?php $number_items = $Item -> item_count($Order -> current_order_id(), "items"); //you can change "items" to "units" to display number of units ?>
- <?php if (!empty($number_items)) : ?>
- <a href="<?php echo $wpcoHtml -> cart_url(); ?>" title="Shopping Cart">Shopping Cart (<?php echo $number_items; ?>)</a>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement