Announcement

Collapse
No announcement yet.

Netquotevar:actinicordertotal

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

    Netquotevar:actinicordertotal

    Hi All

    Probably dead easy if you do Java. Unfortunately, I don't

    I need to convert NETQUOTEVAR:ACTINICORDERTOTAL in Order4.html into pounds and pence without the currency symbol, i.e. change the base currency unit from pence to pounds, e.g.

    if ACTINICORDERTOTAL = 16999

    I want a variable that is 169.99 for passing to our affiliate tracking.

    Can anyone give me a steer?

    Cheers

    Lee.
    http://www.ihavetohave.it

    #2
    Try this:

    Code:
    <script language="JavaScript1.2">
      <!--
    
      var act_price = "NETQUOTEVAR:ACTINICORDERTOTAL"
      var pounds = act_price.slice(0,-3) 
      var pennies = act_price.substr(-2,2)
    
      document.write(pounds + "." + pennies)
    
      //-->
    </script>
    Nick Morecroft
    01392 434530
    <A target=_blank href ="http://www.pinbrookhosting.co.uk/">http://www.pinbrookhosting.co.uk/</A>
    hosting, search engine optimisation, design and ecommerce

    Comment


      #3
      Thanks very much Nick.

      How could this be used in a function to pass to an affiliate scheme as in the AUG:

      <IMG SRC="httpS://www.server.com/log.cgi?amount=NETQUOTEVAR:ACTINICORDERTOTAL&orderid=NETQUOTEVAR:THEORDERNUMBER">

      ???

      TIA

      Lee.
      http://www.ihavetohave.it

      Comment


        #4
        Have a go with this:
        Code:
        <script language="JavaScript1.2">
          <!--
        
          var act_price = "NETQUOTEVAR:ACTINICORDERTOTAL"
          var pounds = act_price.slice(0,-3) 
          var pennies = act_price.substr(-2,2)
          var affiliate_total = pounds + "." + pennies
          document.write("<IMG SRC='httpS://www.server.com/log.cgi?amount=" + affiliate_total + "&orderid=NETQUOTEVAR:THEORDERNUMBER'>")
        
          //-->
        </script>
        Nick Morecroft
        01392 434530
        <A target=_blank href ="http://www.pinbrookhosting.co.uk/">http://www.pinbrookhosting.co.uk/</A>
        hosting, search engine optimisation, design and ecommerce

        Comment


          #5
          Thanks Nick. I was hoping that by presenting what I want to do in the context of the AUG that it would be useful for others. It hopefully is but it's not for me

          Our affiliate operator takes this code:

          <script language="javascript">

          merchantID = MERCHANT_SITE_ID
          payoutCodes = ""
          offlineCode = ""

          orderValue = ORDER_VALUE
          orderRef = ORDER_REFERENCE

          AFProcessSaleV2(merchantID, orderValue, orderRef, payoutCodes, offlineCode)
          ORDER_REFERENCE can just be replaced by NETQUOTEVAR:THEORDERNUMBER but I'm struggling to replace ORDER_VALUE with anything meaningful. I simply want to have

          orderValue = NETQUOTEVAR:ACTINICORDERTOTAL / 10 but unfortunately, I don't do Java.

          I sense that I'm *so* close to this......
          http://www.ihavetohave.it

          Comment


            #6
            This is the correct syntax (which you already have!) to divide by 100. (I think it is 100 that you want to divide by, and not 10?)

            orderValue = NETQUOTEVAR:ACTINICORDERTOTAL / 100
            Nick Morecroft
            01392 434530
            <A target=_blank href ="http://www.pinbrookhosting.co.uk/">http://www.pinbrookhosting.co.uk/</A>
            hosting, search engine optimisation, design and ecommerce

            Comment


              #7
              Hi Nick

              Spot on on the 10 vs 100.

              I tried exactly this (I knew my old Computer Science degree was good for something) yet when I view source on the receipt page, I have:

              orderValue = 13999 / 100
              orderRef = 17369160000116
              for an order with a value of £139.99.

              In this section of Act_Order04.html, I have:

              orderValue = NETQUOTEVAR:ACTINICORDERTOTAL / 100
              orderRef = NETQUOTEVAR:THEORDERNUMBER
              I'm well confused.

              L.
              http://www.ihavetohave.it

              Comment


                #8
                Just merge Nick's earlier reply with what your merchant needs:-

                Code:
                <script language="javascript"> 
                
                // nicks bit
                  var act_price = "NETQUOTEVAR:ACTINICORDERTOTAL";
                  var pounds = act_price.slice(0,-3);
                  var pennies = act_price.substr(-2,2);
                
                // now make into a number
                  orderValue = (pounds + "." + pennies) - 0;
                
                // and the merchant bit
                merchantID = MERCHANT_SITE_ID 
                payoutCodes = "" 
                offlineCode = "" 
                orderRef = NETQUOTEVAR:THEORDERNUMBER 
                
                AFProcessSaleV2(merchantID, orderValue, orderRef, payoutCodes, offlineCode)
                Norman
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Now up & running. The solution was the NETQUOTEVAR:ACTINICORDERVALUE/100 but I was just confusing myself looking at the source.

                  Thanks for all your help Nick & Norman.

                  You should consider selling these scripts to Actinic
                  http://www.ihavetohave.it

                  Comment

                  Working...
                  X