We have a special page which has Register control of Ablecommerce. I modified Registerdialog.ascx so that when the user logs in through this page we assign them to a special volume discount group and redirect them to a special category which has products with special volumediscount associated to that category.
I am doing it like this
if ((Token.Instance.UserId != newUserId) && (newUserId != 0))
{
User.Migrate(Token.Instance.User, newUser);
Token.Instance.UserId = newUserId; //this is AbleCommerce Code
if (_isSpecialuser)//this is being passed from usercontrol attribute
{
newUser.UserGroups.Add(new UserGroup(newUser.UserId, 14));
newUser.Save();
if (!newUser.IsAnonymous)
Response.Redirect("categorylist.aspx?categoryid=98");
}
}
1. Problem is after I redirect him to this page, his status is still "Anonymous".
2. The not newUser.Isanonymous condition is returning true and the user is redirected to category=98 page.
3. I checked the user Id being retrieved in categorylist.aspx page and it says a differnt userid(anonymous userid) and not the newUser.userId.
hence, when I add the product in category =98 to cart I am not getting the volume discount associated to that category.
What is that I am missing? Why isn't response.redirect taking the authenticated userid?
Any help??
thanks
Carol
assiging user to a volume discount group dynamically
-
- Commander (CMDR)
- Posts: 121
- Joined: Wed Dec 17, 2008 9:13 am
-
- Commander (CMDR)
- Posts: 121
- Joined: Wed Dec 17, 2008 9:13 am
Re: assiging user to a volume discount group dynamically
does any one know how Token.Instance.Userid gets filled?
Any help from dev team please......
Any help from dev team please......
Re: assiging user to a volume discount group dynamically
Check the ConLib/RegisterDialog(Out of the Box) control's code in detail that how it is migrating anonymous user after registration.
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: assiging user to a volume discount group dynamically
AbleCommerce uses ASPNET Forms Authentication for user tracking. After you have established your new user, you will need to tell the browser that the user is authenticated. In other words, set a cookie.Carolharry wrote:What is that I am missing? Why isn't response.redirect taking the authenticated userid?
Code: Select all
if (!newUser.IsAnonymous)
{
FormsAuthentication.SetAuthCookie(newUser.UserName, false);
Response.Redirect("categorylist.aspx?categoryid=98");
}
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.