Posted By

ecksteing on 08/30/12


Tagged

php html wordpress plugins E-commerce


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

kimil
Josueriv


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


 / Published in: HTML
 

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

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

  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-->

Report this snippet  

You need to login to post a comment.