BV Commerce Forum
»
BV Commerce Support
»
General Support
»
Preventing a user from adding products to the shopping cart until they log in
Rank: Member
Joined: 11/15/2006(UTC) Posts: 52
|
Is there a switch in the admin panel?
|
|
|
|
Rank: Member
Joined: 3/8/2007(UTC) Posts: 139
|
Hi Dom, There is currently no switch or configuration that will allow you to do this in BVC 5. Would a private store work for your situation? This would require users to create a user account and login before browsing the store.
Everett |
Everett Comstock
BV Software |
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Hi Dom,
One implementation that may work for you, is to simply modify the AddToCartEvent provided in the ProductTemplate.
In whatever ProductTemplate you are using find the AddtoCartClicked Sub in the Product.aspx.vb file.
At the first line of the Subroutine, Add the following code
If SessionManager.IsUserAuthenticated = False Then MessageBox.ShowError("Must Be Logged In To Add Product To Cart") args.IsValid = False Else
And before the "End Sub" add
End If
That code will Display whatever error message you put in quotes at the top of the page if a user is not logged in. You obviously could also, get more complex and redirect to the login page, etc, but that is just the simpliest way I could think of. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 11/15/2006(UTC) Posts: 52
|
|
|
|
|
Rank: Member
Joined: 6/26/2007(UTC) Posts: 14
|
Hi there
Just wondering if there was a simple code change along the lines of "If SessionManager.IsUserAuthenticated" to check to see if a user belongs to any price group? By default, we'd like to hide all pricing, 'add to cart' and 'add to wishlist' sections throughout our site so that wholesale customers must not only have an account, but also have been added to a price group before being able to browse prices and add items to their carts.
Alternatively, would it be easier to use the existing 'Wholesale Customers' group role or create a new role for this same purpose?
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.