Merchant Affiliate Program
http://forums.mygiftlist.com/affiliates/kb/

aitsafe.com integrations instructions
http://forums.mygiftlist.com/affiliates/kb/viewtopic.php?f=7&t=16
Page 1 of 1

Author:  admin [ Mon Jul 26, 2004 12:35 pm ]
Post subject:  aitsafe.com integrations instructions

To integrate MyGiftList with a site that uses aitsafe.com for e-commerce, cut and paste the "Add to MyGiftList" HTML code below after the Add to Cart graphic HTML code but before the </form> tag in your web page.

Remember to change "Your Affiliate ID" below to your MyGiftList Affiliate ID and "Your Store Name" below to the name of your store.


Code:
<!-- BEGIN MyGiftList Code -->
<!--  change "Your Affiliate ID" below to your MyGiftList Affiliate ID -->
<!--  change "Your Store Name" below to the name of your store -->

<input type="image" onclick="javascript:mmMGLpopup(this.form);return false" src="http://www.mygiftlist.com/gif/AddtoMyGiftList7e.gif" width=68 height=26 border=0 alt="Click to Add to MyGiftList!">
<script language=javascript>
function mmMGLpopup(ff) {
   var refsource = "Your Affiliate ID";
   var storename = "Your Store Name";
   var giftPrice = "";
   var giftName = "";
   if (ff) {
      for (var i = 0; i < ff.elements.length; i++) {
         if (ff.elements[i].name == "product[]1") {
            giftName = ff.elements[i].value;
         }
         if (ff.elements[i].name == "product") {
            giftName = ff.elements[i].value;
         }
         if (ff.elements[i].name == "price") {
            giftPrice = ff.elements[i].value;
         }
      }
   }
   var u
   u = "http://www.mygiftlist.com/register_gift.asp?refSource=" + escape(refsource) + "&giftURL=" + escape(document.URL) + "&giftName=" + escape(giftName) + "&giftRetailer=" + escape(storename) + "&giftPrice=" + escape(giftPrice);
   var mgl = window.open(u,"MGL","width=710,height=500,top=60,left=100,resizable,scrollbars");
}
</script>

<!-- End MyGiftList Code -->

Author:  admin [ Thu Jan 19, 2006 3:20 pm ]
Post subject:  Code that works if your options have different pricing

To integrate MyGiftList with a site that uses aitsafe.com and has products with options that have different pricing, cut and paste the "Add to MyGiftList" HTML code below after the Add to Cart graphic HTML code but before the </form> tag in your web page.

Remember to change "Your Affiliate ID" below to your MyGiftList Affiliate ID and "Your Store Name" below to the name of your store.

Code:
<!-- BEGIN MyGiftList Code -->
<!--  change "Your Affiliate ID" below to your MyGiftList Affiliate ID -->
<!--  change "Your Store Name" below to the name of your store -->
<br>
<br>

<input type="button" value="Add to Gift Registry" onclick="javascript:mmMGLpopup(this.form);return false;">
<script language=javascript>
function mmMGLpopup(ff) {
   var refsource = "Your Affiliate ID";
   var storename = "Your Store Name";
   var giftPrice = "";
   var giftName = "";
   var giftDescription = "";
   var m = "";
   var u = "";
   var temp = "";
   var x;
   var y;

   if (ff) {
       for (var i = 0; i < ff.elements.length; i++) {
           if (ff.elements[i].name == "product[]") {
              if ( giftName != "" ) {
                    giftName = giftName + ", "
              }
               giftName = giftName + ff.elements[i].value;
            }
            if (ff.elements[i].name == "product") {
              if ( giftName != "" ) {
                    giftName = giftName + ", "
               }
               giftName = ff.elements[i].value;
            }
            if (ff.elements[i].name == "productpr") {
               temp = ff.elements[i].value;
            //alert(temp);
            x =  temp.indexOf(":");
               if (x > 0) {
               y = temp.indexOf(":", x+1);
               if (y < x) { y = temp.length; }
               //alert(temp.substring(x+1, y));
                  if (!(isNaN(temp.substring(x+1, y)))) {
                        giftPrice = temp.substring(x+1, y)
                        temp = temp.substring(0, x-1);
                    }
               }   
       
               if ( giftName != "" ) {
                  giftName = giftName + ", "
               }
               giftName = giftName + temp;
            }
            if (ff.elements[i].name == "price") {
                if (giftPrice == "") {
                     giftPrice = ff.elements[i].value;
               }
            }
            if (ff.elements[i].name == "product[]" ) {
               m = ff.elements[i].selectedIndex;
               if (m > -1) {
                   u = u + ff.elements[i].options[m].text + ", ";
               }
            }
         }
    }

    if ( u != "" ) {
       u = u.substr(0, u.length-2);
         u = "I would like these options: " + u;
         giftDescription = u + ".  " + giftDescription;
      }

    u = "http://www.mygiftlist.com/register_gift.asp?refSource=" + escape(refsource) + "&giftURL=" + escape(document.URL) + "&giftName=" + escape(giftName) + "&giftRetailer=" + escape(storename) + "&giftPrice=" + escape(giftPrice) + "&giftDescription=" + escape(giftDescription);

    var mgl = window.open(u,"MGL","width=710,height=500,top=60,left=100,resizable,scrollbars");

}
</script>

<!-- End MyGiftList Code -->


Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/