Announcement

Collapse
No announcement yet.

Order Subtotal in Receipt Page Tracking

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

    Order Subtotal in Receipt Page Tracking

    I want to use the subtotal (before VAT) in the Receipt page for tracking purposes but can't find a variable that works.

    I am testing as follows, which works:

    <script language="javascript" type="text/javascript">
    var total = NETQUOTEVAR:ACTINICORDERTOTAL;
    document.write(total);
    </script>

    But I thought NETQUOTEVAR:ACTINICSUBTOTAL was valid but that doesn't work.

    Anyone know what variable is available that iwill work for this?

    #2
    Try

    var total = 'NETQUOTEVAR:ACTINICORDERTOTAL';

    As this is unlikely to be a pure number (£ sign, possible thousand commas, etc).
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      var total = 'NETQUOTEVAR:ACTINICORDERTOTAL'; works but it is the grand total of the order - I need the subtotal before VAT etc.

      Comment


        #4
        If you have the vat one available, could you not do the calculation yourself?

        order - vat = sub etc.

        Comment


          #5
          Unfortunately the subtotal also excludes shipping as well as VAT

          Comment


            #6
            i think norman struggle with these when he knocked up a script that i could use to highlight the discount bands.

            Although i might be wrong but the script uses carttotal if that helps. This was from the cookie though not the page (maybe this was what the problem norman had and why he used the cookie?)

            Comment


              #7
              I will take a look and see if I can add an echo that will write some js code to the page that will set a variable equal to the subtotal.

              Comment


                #8
                Here's how I'd go about it. In my V10, looking at the Receipt layout, I see that the Subtotal comes from a layout called "Sub Total Row". It contains:
                Code:
                <Actinic:REMOVE TAG="SubTotalRow">
                <tr>
                   <td align="right" colspan="<Actinic:Variable Name="PriceColSpan"/>"><b><Actinic:Variable Name="SubTotalCaption"/></b></td>
                   <td align="right" class="cart"><Actinic:Variable Name="SubTotal"/></td>  
                </tr>
                </Actinic:REMOVE>
                If we make a benign tweak to that layout so it becomes:
                Code:
                <Actinic:REMOVE TAG="SubTotalRow">
                <tr>
                   <td align="right" colspan="<Actinic:Variable Name="PriceColSpan"/>"><b><Actinic:Variable Name="SubTotalCaption"/></b></td>
                   <td id="subtotaltd" align="right" class="cart"><Actinic:Variable Name="SubTotal" selectable="false" /></td>  
                </tr>
                </Actinic:REMOVE>
                Which will not interfere with its use on other pages.

                Then a bit of JavaScript further down the receipt page might be:
                Code:
                <script>
                var stotal = document.getElementById('subtotaltd').innerHTML.replace(/[^\d\.]/g, '');
                document.write(stotal);
                </script>
                The regexp removes all characters except numbers and the decimal point so you should get a clean number.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Many thanks Norman. That works great. Much appreciated.

                  Comment


                    #10
                    Thanks from me as well Norman, just used this in my Twenga mash plugin. It worked a treat.

                    Cheers,
                    Jan Strassen, Mole End Software - Plugins and Reports for Actinic V4 to V11, Sellerdeck V11 to V2018, Sellerdeck Cloud
                    Visit our facebook page for the latest news and special offers from Mole End

                    Top Quality Integrated label paper for Actinic and Sellerdeck
                    A4 Paper with one or two peel off labels, free reports available for our customers
                    Product Mash for Sellerdeck
                    Link to Google Shopping and other channels, increase sales traffic, prices from £29.95
                    Multichannel order processing
                    Process Actinic, Sellerdeck, Amazon, Ebay, Playtrade orders with a single program, low cost lite version now available from £19.95

                    Comment


                      #11
                      Error in script but it still works?!?!?

                      Hi Norman

                      I have been working with Duncan to get some of our tracking scripts to pass through a value of subtotal instead of total. Using your advice we tweaked the following bit of tracking code from:

                      var rev = 'NETQUOTEVAR:NUMERICORDERTOTALCGI';
                      to:

                      var rev = 'document.getElementById('subtotaltd').innerHTML.replace(/[^\d\.]/g, '');
                      track.totalHT = stotal';
                      and this successfully passed the subtotal value through to the provider's tracking system. Thanks.

                      However even though it is working there is a error (typo on my side) in the code, namely the "track.totalHT" which actually comes from another provider's tracking script that I have muddled up (typo). We think the "track.totalHT" should be changed with "var rev" however before I change it we wondered if you could shed any light on why the script is still working, even with this typo?

                      We can't figure this out and it would be useful to understand the code before we use it further.

                      To assist, this is the full code before change (e.g. giving order total, not subtotal)...

                      <script type="text/javascript">
                      <!--
                      /* ROI Optimizer Data */
                      var id = '4506718';
                      var rev = 'NETQUOTEVAR:NUMERICORDERTOTALCGI';
                      var order = 'NETQUOTEVAR:THEORDERNUMBER';
                      //-->
                      </script>
                      <script type="text/javascript" src="https://imgsrv.xyz.com/imagefiles/includes/roitrack.js"></script>
                      and this is the full code after the change (e.g. with order subtotal but contains the typo, yet the code still works)...

                      <script type="text/javascript">
                      <!--
                      /* ROI Optimizer Data */
                      var id = '4506718';
                      var rev = 'document.getElementById('subtotaltd').innerHTML.replace(/[^\d\.]/g, '');
                      track.totalHT = stotal';
                      var order = 'NETQUOTEVAR:THEORDERNUMBER';
                      //-->
                      </script>
                      <script type="text/javascript" src="https://imgsrv.xyz.com/imagefiles/includes/roitrack.js"></script>
                      Do you have any idea why this code still works with the track.totalHT = in it? The tracking provider doesn't use this, they use var rev =. It is really strange!?!

                      Thanks in advance.

                      Paul
                      KJ Beckett
                      Men's Clothing & Accessories
                      Cufflinks, Underwear, Ties, Grooming Products
                      Bath, England
                      Fast delivery to UK, USA and worldwide.
                      Men's Fashion Blog

                      Comment


                        #12
                        Given the code works despite the provider not using "track.totalHT", I was wondering if the line...

                        track.totalHT = stotal';
                        ...is not required at all in the script? What does this bit do?

                        Paul
                        KJ Beckett
                        Men's Clothing & Accessories
                        Cufflinks, Underwear, Ties, Grooming Products
                        Bath, England
                        Fast delivery to UK, USA and worldwide.
                        Men's Fashion Blog

                        Comment

                        Working...
                        X