Follow these steps to install the osCommerce 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 osCommerce PHP Shopping Cart Script. This code was tested with osCommerce 2.2CVS.

http://www.oscommerce.com/downloads


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 /catalog/product_info.php file.

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

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

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
------------------------------------------------------------------------------------------------>
</td></form>
<form action=http://www.mygiftlist.com/register_gift.asp method=post target=MGL>
<td width=90 align=right>
<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 $product_info['products_name']; ?></textarea>
<input type=hidden name=giftPrice value="<?php echo ( $new_price ? $currencies->display_price($new_price, $osC_Tax->getTaxRate($product_info['products_tax_class_id'])) : $currencies->display_price($product_info['products_price'], $osC_Tax->getTaxRate($product_info['products_tax_class_id']))); ?>">
<textarea rows=1 cols=10 name=giftDescription style="display:none"><?php echo $product_info['products_model'] . " " . stripslashes($product_info['products_description']); ?></textarea>
<input type=hidden name=giftURL value="">
<input type=hidden name=giftImage value='<?php echo DIR_WS_IMAGES . $product_info['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:oscMGLpopup(this.form);>

<script language=javascript>
function oscMGLpopup(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=600,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 /catalog/product_info.php file of your web site with the product_info-2.2cvs.php file included in this zip file and then perform Step 6 above.

If you would also like to have Add to MyGiftList buttons on your multiple product listing page, you can replace the /catalog/includes/modules/product_listing.php file of your web site with the product_listing-2.2cvs.php file included in this zip file and then perform Step 6 above.


Please direct all questions to support@mygiftlist.com.
