Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2006
    Posts
    30
    Plugin Contributions
    0

    Javascript Affiliate Code Problem

    Hello

    I have to insert some javascript code for my affiliate program.
    I believe I need to insert it into the checkout success page.

    I pasted it in to
    includes/templates/MYTEMPLATE/templates/tpl_checkout_success_default.php...

    And basically it doesn't do what it supposed to do which is send basic order details to my affiliate program....

    Uhm and I have no idea what to do next...

    This is the code without my variables and values relevant to my site like account number.

    <script language="JavaScript" type="text/javascript">
    <!--
    /*** Set your transaction parameters ***/
    var aw_mid = '';
    var aw_sale = '';
    var aw_extra = '';
    var aw_parts = '';
    var aw_test = '';

    /*** Do not edit below here. ***/
    call = location.protocol.toLowerCase()+"//www.aw";
    call += "in1.co"+"m/sread.j"+"s?a="+aw_mid+"&b="+aw_sale+"&c="+aw_extra+"&d="+aw_parts;
    call += "&t="+aw_test+"&l="+escape(window.location.href)+"&tv=1.0";
    document.write("<s"+"cript language=\"JavaS"+"cript\" type=\"text/javas"+"cript\" src=\""+call+"&tt=js\" id=\"aw_tag\"></s"+"cript>");
    var oImage = new Image;
    oImage.src = call+"&tt=ia";
    -->
    </script>

    <noscript>
    <img src="https://www.awin1.com/sread.img?tt=ns&tv=1.0&merchant={merchant_id}&amount={sale_amount}&ref={order_re ferrence}&parts={transaction_parts}&testmode={0 or 1}" />
    </noscript>


    And this is the code with my variables in:-

    <script language="JavaScript" type="text/javascript">
    <!--
    /*** Set your transaction parameters ***/
    var aw_mid = '2020';
    var aw_sale = 'order_total';
    var aw_extra = 'orders_id';
    var aw_parts = 'default:order_total';
    var aw_test = '0';

    /*** Do not edit below here. ***/
    call = location.protocol.toLowerCase()+"//www.aw";
    call += "in1.co"+"m/sread.j"+"s?a="+aw_mid+"&b="+aw_sale+"&c="+aw_extra+"&d="+aw_parts;
    call += "&t="+aw_test+"&l="+escape(window.location.href)+"&tv=1.0";
    document.write("<s"+"cript language=\"JavaS"+"cript\" type=\"text/javas"+"cript\" src=\""+call+"&tt=js\" id=\"aw_tag\"></s"+"cript>");
    var oImage = new Image;
    oImage.src = call+"&tt=ia";
    -->
    </script>

    <noscript>
    <img src="https://www.awin1.com/sread.img?tt=ns&tv=1.0&merchant=2020&amount=order_total&ref=orders_id&parts=defa ult:order_total&testmode=0" />
    </noscript>

    I think it might have something to do with I'm not inserting into the php file properly...

    Help!

    Thanks
    Zohe

  2. #2
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: Javascript Affiliate Code Problem

    rather than editing the template file and trying to figure out where to put things, stuff it into a file called:

    includes/modules/pages/checkout_success/jscript_awin1_affiliate.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2006
    Posts
    30
    Plugin Contributions
    0

    Default Re: Javascript Affiliate Code Problem

    Dr Byte
    Thanks for replying... and great idea

    Just a few more questions

    can i / do I paste the code as is into a file of its own?

    or do i need to add php code / tags..

    such as
    <?php

    ?>

    or anything else?

    Thanks
    Zohe

  4. #4
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: Javascript Affiliate Code Problem

    as-is would be fine as a starting point.

    At some point you'll likely want to add some <?php ...blah.... ?> code to provide some specific data back to your tracking system... such as order number, order amount, etc. But that's going to require some extra coding.

    For now, best to be sure that it actually works with raw info first.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Mar 2006
    Posts
    30
    Plugin Contributions
    0

    Default Re: Javascript Affiliate Code Problem

    Thanks Dr.Byte for the advice
    Thats been the whole problem so far that code was not transmitting back teh values to Affiliate people

    I assumed i was inserting incorrectly or that I was not adding teh correct php code..

    I will most likely be back for more help :-)

    Thanks
    Zohe

  6. #6
    Join Date
    Mar 2006
    Posts
    30
    Plugin Contributions
    0

    Default Re: Javascript Affiliate Code Problem

    Dear dr Byte

    I did as you suggested put the code as is in its own file. in the dir you told me too.

    Now i get a Javascript Error (the little yellow exclamation mark ! in a triangle) on the bottom left of the checkout success page.

    The error is
    Line : 334
    Char: 4
    Error: Invalid Pointer
    Code:0
    URL: https://www.epicheroes.com/shop/inde...eckout_success

    I am going to remove the file/code (for time being) because I don't know what the error means. Although orders still come thru ok in Admin.

    The main point of the code to transmit data to my Affiliate people is not working.

    I think I need to add relevant php code but am not sure

    Any help would be greatly appreciated
    Thanks
    Zohe

  7. #7
    Join Date
    Mar 2006
    Posts
    30
    Plugin Contributions
    0

    Default Re: Javascript Affiliate Code Problem

    Hello Again
    Sorry about this but I removed that file and still getting that javascript error

    A little confused now...
    Z

 

 

Similar Threads

  1. v139h Help whit affiliate code
    By SkalHuset in forum General Questions
    Replies: 0
    Last Post: 10 Oct 2012, 10:23 AM
  2. v150 Affiliate with unique coupon code?
    By keeperbay in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 17 Sep 2012, 08:49 PM
  3. Where to put my Affiliate Tracking Code??
    By danwebman in forum General Questions
    Replies: 27
    Last Post: 24 Aug 2011, 05:56 PM
  4. Customising Footer to include Affiliate Code?
    By andycole in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Dec 2009, 05:04 PM
  5. Affiliate Code Question
    By kashyyyk in forum General Questions
    Replies: 1
    Last Post: 6 Apr 2009, 06:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg