Merchant Affiliate Program

Support Forum
It is currently Tue Apr 23, 2019 10:17 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Jun 20, 2005 3:34 pm 
Offline
Site Admin

Joined: Mon Mar 29, 2004 3:56 pm
Posts: 114
Note: This feature is for advanced users who can program their shopping carts using a scripting language like .php or .asp. All examples below are written in .asp but there are equivalents for .php and other languages.

You may now mark gifts as purchased or put gifts back on gift registries programmatically by calling the Silent_Buy_Gift script from your shopping cart. This is most useful on the "Thank You for your Purchase" page after a shopper has made a purchase.

Here is how it works.

A shopper visits a gift registry and clicks on a Buy Link to return to the Merchant's store and purchase the item. We pass the MGLGiftID token for that specific gift to the Merchant's store to let the store know which item has been selected by the shopper from the registry.

.asp example:

Code:
myMGLGiftID1 = request("MGLGiftID")


The store captures this token and if the gift is purchased, calls our Silent_Buy_Gift script to let us know the gift has been purchased. The script is called using an IMG tag and returns a transparent .gif. The script should be placed on the "Thank You for your Purchase" page of your checkout process after a gift has been purchased. Placing the IMG tag on this page will have no effect on the operation of your store.

.asp example:

Code:
<img src='http://www.mygiftlist.com/silent_buy_gift.asp?action=buy&mglgiftid=" & server.htmlencode(myMGLGiftID1) & "' border=0 width=1 height=1>


If you wish to put a gift back on a registry (unpurchase) you can call the script with the action variable equal to unbuy like this:

.asp example:

Code:
<img src='http://www.mygiftlist.com/silent_buy_gift.asp?action=unbuy&mglgiftid=" & server.htmlencode(myMGLGiftID1) & "'  border=0 width=1 height=1>


Remember to HTML encode the MGLGiftID token when you pass it back to us.

The above was a simplified overview of the process but because a shopper can click on multiple gifts in their gift registry and purchase multiple gifts, the Merchant store will need to capture each MGLGiftID token that is passed and associate it with the specific Product ID for the specific gift that is being purchased. Otherwise, the shopper may purchases some other gift from your site and you will check off the original gift accidentally.

.asp example:

Code:
session("myMGLGiftID" & myProductID) = request("MGLGiftID")



On the "Thank You for your Purchase" page of your checkout process, you will need to iterate through each purchased item, check to see if that item was one that came from the gift registry, and then call the Silent_Buy_Gift script for each item to check it off.

.asp example:
(This example assumes that NumItemsInCart is the number of items that were purchased from the shopping cart and that myCartProductID is an array of the Product IDs for each item in the cart.)

Code:
For I = 1 to NumItemsInCart
  If session("myMGLGiftID" & myCartProductID[I]) <> "" then
    response.write "<img src='http://www.mygiftlist.com/silent_buy_gift.asp?action=buy&mglgiftid=" & server.htmlencode(session("myMGLGiftID" & myCartProductID[I])) & "' border=0 width=1 height=1>"
  end if
Next


Please contact us if you need help with a particular shopping cart.


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