Announcement

Collapse
No announcement yet.

Using basket contents javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using basket contents javascript

    Hi all

    Along with displaying a summary of the cart contents on a page (by using the Actinic supplied javascript for this purpose), we would like to be able to display one of two alternate images based on whether there is anything in the cart or not.

    i.e., we have an image of a shopping cart that is empty and an image of a shopping cart with stuff in it. When the number of items in the cart is zero, then the former image would be displayed. When the number of items is 1 or more, the second image would be displayed instead.

    Any javascript "gurus" know how we can manipulate the Actinic javascript to display alternate images?

    Thanks in advance.

    Regards

    Nick
    Hazelnet Web Solutions
    www.hazelnet.co.uk
    Actinic & Worldpay Partners
    Specialising in ecommerce and
    online promotion.

    Workwear and Promotional Clothing
    www.workwearhouse.co.uk
    Logo Your Polo!

    #2
    Put this where the cart image is to go. You'll also need to upload the images emptycart.gif and fullcart.gif via Advanced / Additional Files. Also put a copy of these images into PreviewHTML if you use Previews.

    Code:
    <script language=JavaScript>
    <!--
    if ( getCartItem(3) > 0 ) document.write('<img src="fullcart.gif">'); else document.write('<img src="emptycart.gif">');
    // -->
    </script>
    You may also want to add

    width=nnn height=nnn

    before the closing > in the 2 parts above.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman

      Works a treat

      Regards

      Nick
      Hazelnet Web Solutions
      www.hazelnet.co.uk
      Actinic & Worldpay Partners
      Specialising in ecommerce and
      online promotion.

      Workwear and Promotional Clothing
      www.workwearhouse.co.uk
      Logo Your Polo!

      Comment

      Working...
      X