Merchant Affiliate Program

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: OpenCart integration
PostPosted: Wed Dec 19, 2012 6:02 pm 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
To integrate MyGiftList with a site that uses the OpenCart.com shopping cart software for e-commerce, cut and paste the "Add to MyGiftList" HTML code below into the file /catalog/view/theme/default/template/product/product.tpl template of your cart. If you are using a custom theme, you would need to change that product.tpl file. This code was tested with OpenCart 1.5.4.

The code should go immediately after the Add to Wishlist button code. The Add to Wishlist button is this code snippet:
Code:
<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />


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

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

<script language=javascript>
function opencartMGLpopup(refsource, storename, cartname) {
 
  var elements = document.getElementsByClassName('price');
  var str = elements[0].innerHTML;
  var price = parseFloat(str.replace(/,/g,'').replace(/^[^-0-9]*/,''));
 
   var u;
   u = "http://www.mygiftlist.com/register_gift.asp?refSource=" + escape(refsource) + "&giftURL=" + escape(document.URL) + "&giftName=" + escape(document.title) + "&giftPrice=" + escape(price) + "&giftRetailer=" + escape(storename) + "&giftCart=" + escape(cartname);
   var mgl = window.open(u,"MGL","width=700,height=600,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