I'm not sure if this question has been asked already, or if this is even the right place to ask. I know about the way zen-cart flags users upon registration and about the first-time discount coupon used option. This doesn't really work for my situation. What I need to set up is a one-time referral purchase. This customer may or may not have already been a registered user, and regardless of how many orders they have placed with us, we need to be able to capture this one-time referral.
I'm trying to make it so that if someone comes to our site via the following link:
oursite.com/index.php?main_page=index&manufacturers_id=31&referred_by=31
I do the following:
1) capture the "referred_by" information,
2) add it to a cookie for the session
After a sucessful purchase for this session only, then I:
3) check if they have the above cookie set, and if so:
4) save this information in the database (at the same time that the order is released by paypal, I guess).
The rest of the specific details are a little vague and I'm not sure exactly where or how to do the above tasks. (modifying the database, and writing to the database is the easy part, what I am struggling with is figuring out how to record the cookie, retrieve the cookie, and WHEN to record the 'referred by' field with the recently placed order).
If someone could give me some assistance as to which files I need to change, etc, it could help me resolve this much faster.
Thanks in advance!



