Merchant Affiliate Program

Support Forum
It is currently Sat Nov 18, 2017 12:21 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: CubeCart Integration
PostPosted: Mon Nov 16, 2009 5:30 pm 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
To integrate MyGiftList with a site that uses CubeCart.com for e-commerce, cut and paste the "Add to MyGiftList" HTML code below into the /skins/yourtemplatename/styleTemplates/content/viewProd.tpl file of your cart. The code should go right after the Add to Cart button. The Add to Cart button is this code snippet:
Code:
<a href="javascript:submitDoc('addtobasket');" class="txtButton">{BTN_ADDBASKET}</a>


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=image onclick='javascript:cubecartMGLpopup(this.form,"Your Affiliate ID","Your Store Name","cubecart");return false;' src=http://www.mygiftlist.com/gif/AddtoMyGiftList7e.gif width=68 height=26 border=0 alt="Click to Add to MyGiftList!"></a>
<textarea rows=1 cols=10 name=giftName style="display:none">{TXT_PRODTITLE}</textarea>
<input type=hidden name=giftPrice value="{TXT_PRICE}">
<textarea rows=1 cols=10 name=giftDescription style="display:none">{TXT_DESCRIPTION}</textarea>

<script language=javascript>
function cubecartMGLpopup(f, refsource, storename, cartname) {
   var giftPrice = "";
   var giftName = "";
   var giftDescription = "";
   var giftImage = "{IMG_SRC}";
   var giftQuantity = "";
   var u = "";
   var m;

   if (f) {
      giftPrice = f.giftPrice.value;
     giftName = f.giftName.value;
     giftDescription = f.giftDescription.value;
      for (var i = 0; i < f.elements.length; i++) {
         if (f.elements[i].name.indexOf("productOptions[]") == 0 ) {
            m = f.elements[i].selectedIndex;
            if (m > -1) {
                u = u + f.elements[i].options[m].text + ", ";
            }
         }
         if (f.elements[i].name == "quan" ) {
            u = u + "Quantity=" + f.elements[i].value + ", ";
         giftQuantity = f.elements[i].value;
        }
      }
   }

   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)  + "&giftImage=" + escape(giftImage)  + "&giftQuantity=" + escape(giftQuantity) + "&giftDescription=" + escape(giftDescription);
   var mgl = window.open(u,"MGL","width=500,height=400,top=60,left=100,resizable,scrollbars");
}
</script>



For example, here is the Add to MyGiftList button code added to a sample viewProd.tpl file:


Code:
<!-- BEGIN: view_prod -->

<div class="boxContent">
   <!-- BEGIN: prod_true -->
   <strong>{LANG_DIR_LOC}</strong> {CURRENT_DIR}
   
   <form action="{CURRENT_URL}" method="post" name="addtobasket" target="_self">
   
   <p class="txtContentTitle"><strong>{TXT_PRODTITLE}</strong></p>
   
   <div style="text-align: center;"><img src="{IMG_SRC}" alt="{TXT_PRODTITLE}" border="0" title="{TXT_PRODTITLE}" /></div>
   <!-- BEGIN: more_images -->
   <div style="text-align: center;"><a href="javascript:openPopUp('extra/prodImages.php?productId={PRODUCT_ID}', 'images', 548, 455, 0);" class="txtDefault">{LANG_MORE_IMAGES}</a></div>
   <!-- END: more_images -->
   <p>
      <strong>{LANG_PRODINFO}</strong>
   
      <br />
      
      {TXT_DESCRIPTION}
   </p>     
   
   <p>
      <strong>{LANG_PRICE}</strong> {TXT_PRICE}
      <span class="txtSale">{TXT_SALE_PRICE}</span>
   </p>     
   
   <ul>
      <li class="bulletLrg"><a href="index.php?act=taf&amp;productId={PRODUCT_ID}" target="_self" class="txtDefault">{LANG_TELLFRIEND}</a></li>
   </ul>
   
   <!-- BEGIN: prod_opts -->
   <br />
   <strong>{TXT_PROD_OPTIONS}</strong>
   <table border="0" cellspacing="0" cellpadding="3">
      <!-- BEGIN: repeat_options -->
      <tr>
         <td><strong>{VAL_OPTS_NAME}</strong></td>
         <td>
            <select name="productOptions[]">
               <!-- BEGIN: repeat_values -->
               <option value="{VAL_ASSIGN_ID}">
               {VAL_VALUE_NAME}
               <!-- BEGIN: repeat_price -->
               ({VAL_OPT_SIGN}{VAL_OPT_PRICE})
               <!-- END: repeat_price -->
               </option>
               <!-- END: repeat_values -->
            </select>
         </td>
      </tr>
      <!-- END: repeat_options -->
   </table>
   <!-- END: prod_opts -->
   <br />

   <strong>{LANG_PRODCODE}</strong> {TXT_PRODCODE}

   <div>
   {TXT_INSTOCK}<span class="txtOutOfStock"> {TXT_OUTOFSTOCK} </span>
   
    <!-- BEGIN: buy_btn -->
   <div style="position: relative; text-align: right;">{LANG_QUAN}
   <input name="quan" type="text" value="1" size="2" class="textbox" style="text-align:center;" />
   <a href="javascript:submitDoc('addtobasket');" class="txtButton">{BTN_ADDBASKET}</a>

<!-- 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=image onclick='javascript:cubecartMGLpopup(this.form,"Your Affiliate ID","Your Store Name","cubecart");return false;' src=http://www.mygiftlist.com/gif/AddtoMyGiftList7e.gif width=68 height=26 border=0 alt="Click to Add to MyGiftList!"></a>
<textarea rows=1 cols=10 name=giftName style="display:none">{TXT_PRODTITLE}</textarea>
<input type=hidden name=giftPrice value="{TXT_PRICE}">
<textarea rows=1 cols=10 name=giftDescription style="display:none">{TXT_DESCRIPTION}</textarea>

<script language=javascript>
function cubecartMGLpopup(f, refsource, storename, cartname) {
   var giftPrice = "";
   var giftName = "";
   var giftDescription = "";
   var giftImage = "{IMG_SRC}";
   var giftQuantity = "";
   var u = "";
   var m;

   if (f) {
      giftPrice = f.giftPrice.value;
     giftName = f.giftName.value;
     giftDescription = f.giftDescription.value;
      for (var i = 0; i < f.elements.length; i++) {
         if (f.elements[i].name.indexOf("productOptions[]") == 0 ) {
            m = f.elements[i].selectedIndex;
            if (m > -1) {
                u = u + f.elements[i].options[m].text + ", ";
            }
         }
         if (f.elements[i].name == "quan" ) {
            u = u + "Quantity=" + f.elements[i].value + ", ";
         giftQuantity = f.elements[i].value;
        }
      }
   }

   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)  + "&giftImage=" + escape(giftImage)  + "&giftQuantity=" + escape(giftQuantity) + "&giftDescription=" + escape(giftDescription);
   var mgl = window.open(u,"MGL","width=500,height=400,top=60,left=100,resizable,scrollbars");
}
</script>

<!-- End MyGiftList Code -->   
   
   </div>
   <!-- END: buy_btn -->
   </div> 
<input type="hidden" name="add" value="{PRODUCT_ID}" />
</form>
<!-- END: prod_true -->
<!-- BEGIN: prod_false -->
<p>{LANG_PRODUCT_EXPIRED}</p>
<!-- END: prod_false -->

</div>
<!-- END: view_prod -->


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