Limiting Affiliate Orders
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
Limiting Affiliate Orders
Hello,
I want to only associate an order with an affiliate once. What I mean is this... person X comes to mysite.com/SomeProduct.aspx?afid=1 and they order that product. That order should be associated with that affiliate. But now, if person X orders product Y in a totally NEW order, I do NOT want the affiliate to be associated with that order.
Does that make sense? How do I do this.
I know you can limit the time in DAYS, but it would be handy to set a limit like I mentioned above, or set a limit in MINUTES.
How can I go about doing this?
Thanks!
I want to only associate an order with an affiliate once. What I mean is this... person X comes to mysite.com/SomeProduct.aspx?afid=1 and they order that product. That order should be associated with that affiliate. But now, if person X orders product Y in a totally NEW order, I do NOT want the affiliate to be associated with that order.
Does that make sense? How do I do this.
I know you can limit the time in DAYS, but it would be handy to set a limit like I mentioned above, or set a limit in MINUTES.
How can I go about doing this?
Thanks!
Re: Limiting Affiliate Orders
I guess you are looking for the ability of specifying the affiliate association for only one order for a customer. I believe this could be done with some code in OnePageCheckout. In my opinon CheckingOut event handler of OnePageCheckout would be a nice place to do this stuff. Edit Your ConLIb/OnePageCheckout.ascx.cs file and place this code just above the closing brace of its CheckingOut event handler.
Code: Select all
if (Token.Instance.User.AffiliateId > 0)
{
OrderCollection ordersWithAffiliate = OrderDataSource.LoadForCriteria(string.Format("UserId={0} AND AffiliateId={1}", Token.Instance.UserId, Token.Instance.User.AffiliateId));
if (ordersWithAffiliate.Count > 0)
{
//NOT A VALID AFFILIATE SO REMOVE IT
Token.Instance.User.AffiliateId = 0;
Token.Instance.User.Save();
}
}
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
Re: Limiting Affiliate Orders
NICE! Thanks Mazhar.
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
Re: Limiting Affiliate Orders
In the criteria, can I specify a time? If more than a day has passed, it's okay if the affiliate is associated with an order.
How do I do this?
Thanks for all your help Mazhar.
How do I do this?
Thanks for all your help Mazhar.
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
Re: Limiting Affiliate Orders
Actually even better -- on the ReceiptPage.ascx.cs, how can I remove all references to an affiliate?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Limiting Affiliate Orders
This might work- in Able 5 there was a setting where you could make an affiliate's orders persistent or not.
In the Able 7 admin, there is a field "Referral Days". If you set that to one, it might accomplish what you want, but I'm not sure.
In the Able 7 admin, there is a field "Referral Days". If you set that to one, it might accomplish what you want, but I'm not sure.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
Re: Limiting Affiliate Orders
Thanks for all the insight.
On the ReceiptPage control, in the Page_Init I added the following code:
On the ReceiptPage control, in the Page_Init I added the following code:
Code: Select all
Token.Instance.User.AffiliateId = 0;
Token.Instance.User.Save();