Merchant Affiliate Program

Support Forum
It is currently Sat Sep 23, 2017 3:29 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Sage Pastel integration
PostPosted: Tue Dec 03, 2013 3:41 pm 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
To integrate MyGiftList with a site that uses the Sage Pastel Shopping Cart, http://www.sagepastel.com , for e-commerce, cut and paste the "Add to MyGiftList" HTML code into the Branding template that is used for your store. To find this field, login to your store control panel and click on Placeholders then Branding in the left menu.

The code can go anywhere in the Branding html.

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

You will also want to create a new Gift Registry page in your store and add the Login Code so visitors can create, find, and login to their registries from your website.


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  -->
<!-- -->

<!-- MyGiftList Add Button Code Begin -->
   
 <div id="mgldiv1" style="Z-INDEX: 111; position:absolute; display: none">
   
 <a id=mglhref href='javascript:sagepastelMGLpopup("Your Affiliate ID","Your Store Name","sagepastel");' ><img src="http://images.mygiftlist.com/gif/AddtoMyGiftList7e.gif" width=68 height=26 border=0 alt="Click to Add to MyGiftList!"></a>
   
 </div>
   
 <script language=javascript>
 
$(document).ready(function(){
      if (document.getElementById("product-social")) {
         document.getElementById("product-social").appendChild(document.getElementById("mglhref"));
      }
      });
 

 function sagepastelMGLpopup(refsource, storename, cartname) {
    var p;
    var u;
    var m;
    var d;
    var giftPrice;
    var q;
    var giftName;
   var giftImage;
   var storeCode;
     
    u = "";

    p = document.forms["frmQuantity"];
    if (p) {
       for (var i = 0; i < p.elements.length; i++) {
          if (p.elements[i].name.indexOf("SELECT___") == 0 ) {
             m = p.elements[i].selectedIndex;
             if (m > -1) {
                 u = u + p.elements[i].options[m].text + ", ";
             }
          }
          if (p.elements[i].name.indexOf("Quantity") == 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;
    }
   
   storeCode = scrapeStoreCode("Store code:");
    if ( storeCode != "" ) {
       u =  "Store Code: " + storeCode + ", " + u;
    }

    giftPrice = scrapePrice("Price :");
    if (!(isNumber(giftPrice))) { giftPrice = scrapePrice("Our Price:"); }
    if (!(isNumber(giftPrice))) { giftPrice = scrapePrice("List Price:"); }
    if (!(isNumber(giftPrice))) { giftPrice = scrapePrice("Price"); }
    if (!(isNumber(giftPrice))) { giftPrice = ""; }
     
    giftName = document.frmSubmit.hdnProductName.value;
    if (giftName == null) { giftName = document.title; }
   
    giftImage = document.getElementById("product-main-image").src;
   //alert(giftImage);
    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=700,height=500,top=60,left=100,resizable,scrollbars");
 }
   
 function scrapePrice(s) {
  var p = null;
  var x = 0;
  var y = 0;
  var h;
  if ( document.getElementById("MainArea") ) {   
      h = document.getElementById("MainArea").innerHTML;
     //alert(h);
      x = h.indexOf(s);
     //alert(x);
   if (x > -1) {
    x = h.indexOf("R", x);
    if (x > -1) {
     x = x + 1;
    //alert(x);
     y = h.indexOf("&nbsp;(incl.)", x-1);
    //alert(y);
     if (y > -1) {
      p = h.substr(x, y-x);
     //alert(p);
     p = p.replace("&nbsp;", "");
     //alert(p);
     }
    }
   }
   
  }
  return p
 }


 function scrapeStoreCode(s) {
  var p = null;
  var x = 0;
  var y = 0;
  var h;
  if ( document.getElementById("MainArea") ) {   
      h = document.getElementById("MainArea").innerHTML;
      x = h.indexOf(s);
   if (x > -1) {
    x = h.indexOf('rel="nofollow">', x);
    if (x > -1) {
     x = x + 15;
     y = h.indexOf("</a>", x);
     if (y > -1) {
      p = h.substr(x, y-x);
     }
    }
   }
   
  }
  return p
 }
   
 // check to see if input is number
 function isNumber(val) {
  if ((val==null) || (isNaN(val))) {
   return false;
  } else {
   return true;
  }
 }
   
 </script>
 <!-- MyGiftList Add Button Code End -->



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: Yahoo [Bot] 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