CREATE A HEADER MINI-CART IN WP E-COMMERCE - Part 1


/ Published in: HTML
Save to your folder(s)

CREATE A HEADER MINI-CART IN WP E-COMMERCE - Part 1


Copy this code and paste it in your HTML
  1. <!--start header-cart-->
  2. <div id=""><a href="http://example.com/products-page/checkout/">
  3. <!-- name the class anything you like --> <span class="ge-count">
  4. <? if (function_exists('wpsc_cart_item_count')) { // checks to see if this function exists
  5. if (wpsc_cart_item_count() == 0 || isset($_GET['sessionid'])) { // checks if count is zero or sessionid is set
  6. echo "Shopping cart is empty";
  7. }
  8. elseif (wpsc_cart_item_count() == 1 || isset($_GET['sessionid'])) { // checks if count is one or sessionid is set
  9. echo wpsc_cart_item_count(); // this is the function that checks the item count in your cart
  10. ?>
  11. item in cart
  12. <?
  13. } else
  14. {
  15. echo wpsc_cart_item_count();
  16. ?>
  17. items in cart
  18. <? }
  19. } ?>
  20. </span></a>
  21.  
  22. </div><!--close header-cart-->

URL: http://eckstein.id.au/11946/wordpress/wp-e-commerce-shop-cart/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.