Announcement

Collapse
No announcement yet.

Quantity - Any ideas???

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

    Quantity - Any ideas???

    Hi,

    I am trying to work a bit of JavaScript on the Receipt page, which gets the NETQUOTEVAR:QUANTITY value so I can use it later on in the Receipt page.

    I do the exact same with the product name, and this works 100%, but for some reason the quantity just won't go in.

    I am trying something along the lines of:

    <SCRIPT>
    var ProdName = "NETQUOTEVAR:PRODUCTNAME";
    var ProdQuant = "NETQUOTEVAR:QUANTITY";
    </SCRIPT>

    which i think should work, but for some reason it just ignores the quantity bit. I have tested this quite a number of times, so don't think it is a syntax error.

    If anyone has any ideas about why this might be happening, or has another way of getting individual Product Quantities on the Receipt page then please please please could they let me know.

    Cheers again,

    Stuart
    Tacklebargains.co.uk

    Located: Cheshire, UK

    #2
    See my answer at
    http://community.actinic.com/showthr...=&threadid=401

    Comment


      #3
      I'll try to help but which template of script file are you working on (there are over 150)?

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

      Comment


        #4
        Hi Norman,

        The HTML file that I am doing this in is order04.html, and basically I have added my own JavaScript into it inorder to get the results I need. The only problem I was having was to get the NETQUOTEVAR:QUANTITY value into a variable. When I stepped through the code though, I can only presume that because the QUANTITY tag returns a hidden type value, this stops me from getting the actual data. Anyway, I have now got round the problem by working out the Quantity of each product sold programmatically - which so far is holding together quite well.

        Thanks though,

        Stuart
        Tacklebargains.co.uk

        Located: Cheshire, UK

        Comment


          #5
          Glad you've got a solution. The following might help for later.

          Some NETQUOTEVARS (like NETQUOTEVAR:COST in Act_ProductPrice.html) return a string of info rather than just the number you want.

          You can always extract the bit you need using a regular expression:-

          Say 'NETQUOTEVAR:WHATEVER returns something like <input name="xyz" value="123">

          Then

          var myval = 'NETQUOTEVAR:WHATEVER';
          myval = myval.replace(/value="(.*)">/, "$1") - 0;

          the first line is happy with the double quotes in the returned valus as it is single quoted.

          The second will pick out the numeric bit and convert it to a number.

          You can always stick a line like alert(myval); into your code to see what a value contains


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

          Comment

          Working...
          X