How to make affiliate referral period only last per session?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
bemara579
Lieutenant (LT)
Lieutenant (LT)
Posts: 63
Joined: Thu Feb 19, 2009 6:15 pm

How to make affiliate referral period only last per session?

Post by bemara579 » Tue Apr 28, 2009 11:39 pm

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?

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: How to make affiliate referral period only last per session?

Post by Logan Rhodehamel » Fri May 01, 2009 8:41 am

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.
Cheers,
Logan
Image.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.

Post Reply