Merchant Affiliate Program

Support Forum
It is currently Tue Sep 19, 2017 9:51 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: X-Cart integration
PostPosted: Wed Jul 29, 2009 10:08 am 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
To integrate MyGiftList with a site that uses the the X-Cart Shopping Cart, http://www.x-cart.com, for e-commerce, cut and paste the "Add to MyGiftList" HTML code below into the product.php template page.

Place the below code after your Add to Cart button in the code. Each x-cart store will have a different Add to Cart button.

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> 
<a href='javascript:xcartMGLpopup("Your Affiliate ID","Your Store Name","istar");' ><img src="http://images.mygiftlist.com/gif/AddtoMyGiftList7e.gif" width=68 height=26 border=0 alt="Click to Add to MyGiftList!"></a>

<script language=javascript>
function xcartMGLpopup(refsource, storename, cartname) {
   var p;
   var u;
   var m;
   var d;
   var giftPrice;
   var giftName;
   var giftDescription;
   var giftImage;
   var q;
   var x;
   
   u = "";

   p = document.forms["orderform"];
   if (p) {
         giftName = document.title;
      x = giftName.lastIndexOf("::");
      if (x > 0) {
         giftName = giftName.substring(x+3);
      }
         giftImage = document.getElementById('product_thumbnail').src;
         giftDescription = "";
      giftPrice = document.getElementById('product_price').innerHTML;
      
      for (var i = 0; i < p.elements.length; i++) {
           if (p.elements[i].name.indexOf("product_options") == 0 ) {
             m = p.elements[i].selectedIndex;
            if (m > -1) {
               u = u + p.elements[i].options[m].text + ", ";
            }
          }
          if (p.elements[i].name.indexOf("amount") == 0 ) {
             q = p.elements[i].value;
             u = u + "Quantity=" + q + ", ";
         }
      }
   }
      
  if ( u != "" ) {
      u = u.substr(0, u.length-2);
      u = "I would like these options: " + u;
   }
   
   u = u + ".  " + giftDescription;
   
   u = "http://www.mygiftlist.com/register_gift.asp?refSource=" + escape(refsource) + "&giftURL=" + escape(document.URL) + "&giftName=" + escape(giftName) + "&giftPrice=" + escape(giftPrice) + "&giftRetailer=" + escape(storename) + "&giftCart=" + escape(cartname) + "&giftQuantity=" + escape(q) + "&giftDescription=" + escape(u) + "&giftImage=" + escape(giftImage);
   var mgl = window.open(u,"MGL","width=720,height=500,top=60,left=100,resizable,scrollbars");
}

</script>
<!-- End MyGiftList Code -->


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group