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

Interspire Integration
http://forums.mygiftlist.com/affiliates/kb/viewtopic.php?f=7&t=127
Page 1 of 1

Author:  admin [ Tue Mar 02, 2010 5:58 pm ]
Post subject:  Interspire Integration

To integrate MyGiftList with a site that uses Interspire.com shopping cart software for e-commerce, cut and paste the "Add to MyGiftList" HTML code below into the Snippets/ProductAddToCart.html template of your cart. This code was tested with Interspire Shopping Cart 5.5.

The code should go immediately after the Add to Cart button code. The Add to Cart button is this code snippet:
Code:
<input type="image" src="%%GLOBAL_TPL_PATH%%/images/%%GLOBAL_SiteColor%%/AddCartButton.gif" alt="" />


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 -->
<!--  Add this code before the </form> end tag for the Add to Cart button -->
<!--  change "Your Affiliate ID" below to your MyGiftList Affiliate ID -->
<!--  change "Your Store Name" below to the name of your store -->

<br><input type="image" onclick='javascript:inspireMGLpopup(this.form,"Your Affiliate ID","Your Store Name","inspire");return false;' src="http://images.mygiftlist.com/gif/AddtoMyGiftList7e.gif" width=68 height=26 border=0 alt="Click to Add to MyGiftList!">


<textarea rows=1 cols=10 name=giftPrice id=giftPrice style="display:none">%%GLOBAL_ProductPrice%%</textarea>
<textarea rows=1 cols=10 name=giftName id=giftName style="display:none">%%GLOBAL_ProductName%%</textarea>
<textarea rows=1 cols=10 name=giftDescription id=giftDescription style="display:none">%%GLOBAL_ProductDesc%%</textarea>

<script language=javascript>
function inspireMGLpopup(f, refsource, storename, cartname) {
   var giftPrice = "";
   var giftName = "";
   var giftDescription = "";
   var m;
   var u = "";
   var n;
   var f;
   
   if (f) {
      giftPrice = document.getElementById("giftPrice").innerHTML;
      giftName = document.getElementById("giftName").innerHTML;
      giftDescription = document.getElementById("giftDescription").innerHTML;
     
      for (var i = 0; i < f.elements.length; i++) {
         m = f.elements[i].selectedIndex;
         n = f.elements[i].name
         if (f.elements[i].name == "qty[]" ) {
               u = u + "Quantity=" + f.elements[i].value + ", ";
         } else if (m > -1) {
            u = u + f.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) + "&giftCart=" + escape(cartname) + "&giftPrice=" + escape(giftPrice) + "&giftDescription=" + escape(giftDescription);
   var mgl = window.open(u,"MGL","width=720,height=500,top=60,left=100,resizable,scrollbars");
}

document.getElementsByClassName = function(cl) {
   var retnode = [];
   var myclass = new RegExp('.'+cl+'.');
   var   elem = this.getElementsByTagName('*');
   for (var i = 0; i < elem.length; i++) {
      var classes = elem[i].className;
      if (myclass.test(classes)) retnode.push(elem[i]);
   }
   return retnode;
}
</script>

<!-- End MyGiftList Code -->



For example, here is the Add to MyGiftList button code added to a sample ProductAddToCart.html template:


Code:
<hr />

%%SNIPPET_SideAddItemSoldOut%%

<form method="post" action="%%GLOBAL_CartLink%%" onsubmit="return check_add_to_cart(this, %%GLOBAL_ProductOptionRequired%%)"  enctype="multipart/form-data">
   <input type="hidden" name="action" value="add" />
   <input type="hidden" name="product_id" value="%%GLOBAL_ProductId%%" />
   <input type="hidden" name="variation_id" class="CartVariationId" value="" />
   <input type="hidden" name="currency_id" value="" />
   <dl class="ProductAddToCart">
      %%SNIPPET_VariationList%%
      %%SNIPPET_ProductFieldsList%%
      %%SNIPPET_EventDate%%
      <dt class="QuantityInput" style="display: %%GLOBAL_DisplayAddQty%%;"> %%LNG_QuantityFull%%:</dt>
      <dd class="AddCartButton" style="display: %%GLOBAL_DisplayAdd%%">
         <span class="FloatLeft" style="display: %%GLOBAL_DisplayAddQty%%;">%%GLOBAL_AddToCartQty%%</span>
         <div class="BulkDiscount">
            <input type="image" src="%%GLOBAL_TPL_PATH%%/images/%%GLOBAL_SiteColor%%/AddCartButton.gif" alt="" />
<!-- BEGIN MyGiftList Code -->
<!--  Add this code before the </form> end tag for the Add to Cart button -->
<!--  change "Your Affiliate ID" below to your MyGiftList Affiliate ID -->
<!--  change "Your Store Name" below to the name of your store -->

<br><input type="image" onclick='javascript:inspireMGLpopup(this.form,"Your Affiliate ID","Your Store Name","inspire");return false;' src="http://images.mygiftlist.com/gif/AddtoMyGiftList7e.gif" width=68 height=26 border=0 alt="Click to Add to MyGiftList!">


<textarea rows=1 cols=10 name=giftPrice id=giftPrice style="display:none">%%GLOBAL_ProductPrice%%</textarea>
<textarea rows=1 cols=10 name=giftName id=giftName style="display:none">%%GLOBAL_ProductName%%</textarea>
<textarea rows=1 cols=10 name=giftDescription id=giftDescription style="display:none">%%GLOBAL_ProductDesc%%</textarea>

<script language=javascript>
function inspireMGLpopup(f, refsource, storename, cartname) {
   var giftPrice = "";
   var giftName = "";
   var giftDescription = "";
   var m;
   var u = "";
   var n;
   var f;
   
   if (f) {
      giftPrice = document.getElementById("giftPrice").innerHTML;
      giftName = document.getElementById("giftName").innerHTML;
      giftDescription = document.getElementById("giftDescription").innerHTML;
     
      for (var i = 0; i < f.elements.length; i++) {
         m = f.elements[i].selectedIndex;
         n = f.elements[i].name
         if (f.elements[i].name == "qty[]" ) {
               u = u + "Quantity=" + f.elements[i].value + ", ";
         } else if (m > -1) {
            u = u + f.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) + "&giftCart=" + escape(cartname) + "&giftPrice=" + escape(giftPrice) + "&giftDescription=" + escape(giftDescription);
   var mgl = window.open(u,"MGL","width=720,height=500,top=60,left=100,resizable,scrollbars");
}

document.getElementsByClassName = function(cl) {
   var retnode = [];
   var myclass = new RegExp('.'+cl+'.');
   var   elem = this.getElementsByTagName('*');
   for (var i = 0; i < elem.length; i++) {
      var classes = elem[i].className;
      if (myclass.test(classes)) retnode.push(elem[i]);
   }
   return retnode;
}
</script>

<!-- End MyGiftList Code -->

            <div class="BulkDiscountLink" style="display: %%GLOBAL_HideBulkDiscountLink%%;"><a href="#" onclick="$.iModal({data: $('#ProductDetailsBulkDiscountThickBox').html(), width: 600}); return false;">%%LNG_BulkDiscountLink%%</a></div>
         </div>
      </dd>
   </dl>
</form>

%%GLOBAL_ProductBulkDiscountThickBox%%

<script type="text/javascript">
lang.OptionMessage = "%%GLOBAL_OptionMessage%%";
lang.VariationSoldOutMessage = "%%LNG_VariationSoldOutMessage%%";
lang.InvalidQuantity = "%%LNG_InvalidQuantity%%";
lang.EnterRequiredField = "%%LNG_EnterRequiredField%%";
lang.InvalidFileTypeJS = "%%LNG_InvalidFileTypeJS%%";
var ShowAddToCartQtyBox = "%%GLOBAL_ShowAddToCartQtyBox%%";
</script>
%%GLOBAL_ProductVariationJavascript%%
%%GLOBAL_EventDateJavascript%%

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