Follow these steps to install the Zen Cart PHP Shopping Cart with MyGiftList functionality: 

1. Sign up to be a MyGiftList Merchant Affiliate.  You will receive a MyGiftList Affiliate ID after you sign up.  Signing up is free.
http://www.mygiftlist.com/affiliates

2. Download the Free Zen Cart PHP Shopping Cart Script. This code was tested with Zen Cart v1.1.4d but may work for others.

http://www.zen-cart.com/modules/mydownloads/


3. After downloading the free shopping cart and installing it on your site, you can add the MyGiftList Gift Registry to your site by cutting and pasting HTML code into the includes/templates/template_default/templates/tpl_product_info_display.php file if you are using the default template that came with Zen Cart.  If you have a different template, then find your specific tpl_product_info_display.php file.

4. Open up the tpl_product_info_display.php file in your HTML editor and find this line of code:

            echo zen_get_buy_now_button($_GET['products_id'], $the_button);
            ?>

5. Paste the following code DIRECTLY after this code and before the </td>:

<!--  BEGIN MyGiftList Code  --> 
<!--  change giftRetailer value below from "Your Store Name" to the name of your store  -->
<!--  change refsource value below from "Your Affiliate ID" to your MyGiftList Affiliate ID  -->

<br><br>
</form>
<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"><?php echo $products_name; ?></textarea>
<input type=hidden name=giftPrice value="<?php echo $specials_price ? $specials_price : $products_price; ?>">
<textarea rows=1 cols=10 name=giftDescription style="display:none"><?php echo $products_model . " " . stripslashes($products_description); ?></textarea>
<input type=hidden name=giftURL value="">
<input type=hidden name=giftImage value='<?php echo DIR_WS_IMAGES . $products_image; ?>'>
<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:zenMGLpopup(this.form);>

<script language=javascript>
function zenMGLpopup(f) {
	var p
	var u
	var m
	
	u = "";
	p = document.forms["cart_quantity"];
	if (p) {
		for (var i = 0; i < p.elements.length; i++) {
			if (p.elements[i].name.indexOf("id[") == 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;
		f.giftDescription.value = u + ".  " + f.giftDescription.value;
	}

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


6. Change the below 2 lines in the code you just added by replacing Your Store Name with the name of your store and Your Affiliate ID with your MyGiftList Affiliate ID: 

<input type=hidden name=giftRetailer value="Your Store Name"> 
<input type=hidden name=RefSource value="Your Affiliate ID"> 

7. That's it! 

Alternatively, you can replace the tpl_product_info_display.php file of your web site with the tpl_product_info_display.php file included in this zip file and then perform Step 6 above.

Please direct all questions to support@mygiftlist.com.
