Announcement

Collapse
No announcement yet.

Cannot use shopping cart script on page 31 of Advanced Users Guide

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

    Cannot use shopping cart script on page 31 of Advanced Users Guide

    Help!

    I have been trying to use the script for displaying the number of items and total cost but I cannot get it to work.

    I can however display the number of items and total cost if I just use :

    document.write getCartItem(3)
    document.write getCartItem(1)

    but as soon as I put them within an 'if' statement nothing happens.

    I would be most grateful for any suggestions.
    R & A Online Shop

    For all your business needs.

    http://www.randashop.com

    #2
    Would it be possible for you to post the implementation of the if statement?

    Comment


      #3
      This is what I copied from the Advanced users guide.



      (in between the HEAD tags)


      <SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js"
      TYPE="text/javascript"></SCRIPT>

      (and in the BODY)


      <span class="actxxsmall">
      <script language="JavaScript">
      if (getCartItem(3) < 1)
      {
      document.write("Your cart is empty")
      }
      else
      {
      document.write("You have ordered ")
      document.write(getCartItem(3) + " item");
      if (getCartItem(3) > 1)
      {
      document.write("s");
      }
      document.write("<br>at a cost of " + getCartItem(1));
      }
      </script>
      </span>


      Maybe I'm missing something
      R & A Online Shop

      For all your business needs.

      http://www.randashop.com

      Comment


        #4
        There's nothing inherently wrong with the code as far as I can see, and testing it offline, it works fine. Unfortunately, I can't test it with items in the cart without doing an upload, but it definately works to tell me I have no items in the cart.

        Do you have it uploaded anywhere at the moment? Does the script throw up any errors? What output are you getting, if any?

        Thanks.

        Comment


          #5
          Sorry,

          I must have mistyped or something!

          I've cut and pasted it from the A.U.G. and it's working fine now.

          Many thanks

          Kevin
          R & A Online Shop

          For all your business needs.

          http://www.randashop.com

          Comment


            #6
            Glad to hear it worked out for you

            Comment

            Working...
            X