Merchant Affiliate Program

Support Forum
It is currently Wed Dec 11, 2019 9:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Volusion 4 Integration
PostPosted: Fri May 25, 2007 4:41 pm 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
To integrate MyGiftList with a site that uses the Volusion Shopping Cart, http://www.volusion.com, for e-commerce, cut and paste the "Add to MyGiftList" HTML code below into the ProductDetails.asp file. The ProductDetails.asp file can be found in the LiveEdit File Editor under Webmaster in the Admin area for your store. This code has been tested with version 4.0 of Volusion with SEO optimized filenames enabled.

Place the below code at the end of the file right before this code snippet:

Code:
</html>
<!--#include file="incfiles/MainStoreFile_End.asp" -->


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


Code:
<!-- MyGiftList Add Button Code Begin -->

<div id="mgldiv1" style="Z-INDEX: 111; position:absolute; display: none">

<%

dim pcode
pcode= request.querystring
pcode= mid(pcode, instrrev(pcode,"/")+1)
pcode= left(pcode, len(pcode)-4)

if not isnumeric(pcode) then
   pcode = request.querystring("ProductCode")
end if

if isnumeric(pcode) then
  Dim mglConn
  Set mglConn = Server.CreateObject("ADODB.Connection")
  mglConn.Open Config_ConnectionString
  Dim mglRS
  Dim mglsql
 
  mglsql = "select [productname], [productdescriptionshort], [productprice], [photourl_small] from [Products_Joined] where [productcode] = '" & pcode & "'"
  Set mglRS = mglConn.Execute(mglsql)

  if not mglRS.eof then
%>

<form action=http://www.mygiftlist.com/register_gift.asp method=post target=MGL>
<input type=hidden name=giftRetailer value="Your Store Name">
<input type=hidden name=RefSource value="Your Affiliate ID">
<textarea rows=1 cols=10 name=giftName style="display:none"><%= mglRS("productname") %></textarea>
<textarea rows=1 cols=10 name=giftPrice style="display:none"><%= mglRS("productprice") %></textarea>
<textarea rows=1 cols=10 name=giftDescription style="display:none"><%= mglRS("productdescriptionshort") %></textarea>
<input type=hidden name=giftURL value="">
<textarea rows=1 cols=10 name=giftImage style="display:none"><%= mglRS("photourl_small") %></textarea>
<input type=image src="http://images.mygiftlist.com/gif/AddtoMyGiftList7e.gif" width=68 height=26 border=0 alt="Click to Add to MyGiftList!" onclick="javascript:volusionMGLpopup(this.form);" >
</form>

<%
  end if

  mglRS.close
  set mglRS = Nothing
  mglConn.close
  set mglConn = Nothing

 %>

</div>
 
<script language=javascript>
function volusionMGLpopup(f) {
   var p;
   var u;
   var m;
   var d;
   
   u = "";
   p = document.forms["MainForm"];
   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 ( u != "" ) {
      u = u.substr(0, u.length-2);
      u = "I would like these options: " + u;
      d = f.giftDescription.innerHTML;
      f.giftDescription.innerHTML = u + ". " + d;
   }

   f.giftURL.value = document.URL;
   var w = window.open('', "MGL", "width=700,height=500,top=60,left=100,resizable,scrollbars");
   w.focus;
   f.submit;
}
</script>

<% end if %>

<SCRIPT language=javascript>
 
var IE4 = (document.all) ? true : false;
var NS4 = (document.layers) ? true : false;

function docjslib_getImageXfromLeft(imgID) {
  if (NS4) return eval(imgID).x
  else return docjslib_getRealLeft(imgID);
}
function docjslib_getImageYfromTop(imgID) {
  if (NS4) return eval(imgID).y
  else return docjslib_getRealTop(imgID);
}
function docjslib_getRealLeft(imgElem) {
   xPos = eval(imgElem).offsetLeft;
   tempEl = eval(imgElem).offsetParent;
     while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
     }
   return xPos;
}
function docjslib_getRealTop(imgElem) {
   yPos = eval(imgElem).offsetTop;
   tempEl = eval(imgElem).offsetParent;
   while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
     }
   return yPos;
}
      
function moveButton() {
   if ( document.getElementById ) {   
      document.getElementById("mgldiv1").style.left = docjslib_getImageXfromLeft(document.getElementById("content")) + 645;
      document.getElementById("mgldiv1").style.top = docjslib_getImageYfromTop(document.getElementById("content")) + 40;
      document.getElementById("mgldiv1").style.display = '';
   }
}

moveButton();

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


You will also want to modify the <body> tag to include calling the moveButton() function when onResize is called like this:

Code:
<body <%=BodyOnLoad%> onResize="moveButton();" >


Top
 Profile  
 
PostPosted: Wed Jan 02, 2008 4:03 pm 
Offline

Joined: Wed Jan 02, 2008 4:01 pm
Posts: 2
This code is not working, what am I doing wrong?


Top
 Profile  
 
PostPosted: Wed Jan 02, 2008 5:35 pm 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
Please contact support with the URL of your website so we can review.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 0 guests


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