an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 9/14/2009 2:51:33 PM By bansal_db. 3 replies.
9/11/2009 9:28:54 AM
bansal_db
Posts: 181
Joined: 4/13/2009
Produt Profiling
Hey Luke,
 
We have certain products that we don't want to sell to all the customers. For example: there is a phone brand we are not allowed to sell in NY but we can sell to all other states. I added a custom field in DSC_User which would be 1 if customer is allowed to buy product for this brand and it will be 0 if he is not.
 
I also added the code to check if the product belongs to this category or not.
 
I did all this in core project.
 
Only thing left is to throw an error, when customer tries to add this product to the cart, if he is not allowed to buy it.
 
I am not sure which part of the code to check this for. I want to throw the error before its even added to the cart.
 
I tried modifying Store/ItemAddedToCart.aspx but that didn't work.
 
Can you please help.
 
Thanks
 
-D
9/14/2009 9:16:41 AM
bansal_db
Posts: 181
Joined: 4/13/2009
Re: Produt Profiling
Luke,
 
Anything on this?
 
THanks
 
 
9/14/2009 10:53:59 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Produt Profiling
The best place to make the change is method ProductAction1_AddingToCart in Store/Product.ascx.cs, where you can check if product is allowed to purchase.
 
DotShoppingCart Staff
9/14/2009 2:51:33 PM
bansal_db
Posts: 181
Joined: 4/13/2009
Re: Produt Profiling
That worked. Thanks