I notice admin panel, the affiliate edit page has a "Referral Period" in days. Is there any way to make it so that the referral period only lasts as long as the user's visit?
For example, a user comes to my store with an affiliate url parameter. The user is associated with that affiliate as long as the user stays in the store. Once the user leaves the store, their affiliate referral period gets forcefully expired. Any ideas on how to achieve this?
How to make affiliate referral period only last per session?
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How to make affiliate referral period only last per session?
You would need to customize in a handful of places, maybe an intermediate task?
1) use a session start hander in the global.asax, on session start look for an affiliate id in the url. If you find it, set a session variable. Make sure to set User.AffiliateId to 0 and save the user.
2) customize one page checkout in the ConLib folder. In the "checkingout" handler, look at your session variable and set the user affiliate ID if you find it. In the "checkedout" handler, clear the user affiliate ID again.
I think something along these lines would work. Once the user session expires, the affiliate ID association would be gone.
1) use a session start hander in the global.asax, on session start look for an affiliate id in the url. If you find it, set a session variable. Make sure to set User.AffiliateId to 0 and save the user.
2) customize one page checkout in the ConLib folder. In the "checkingout" handler, look at your session variable and set the user affiliate ID if you find it. In the "checkedout" handler, clear the user affiliate ID again.
I think something along these lines would work. Once the user session expires, the affiliate ID association would be gone.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.