kentico_borisp
-
11/10/2010 4:25:42 AM
RE:e-commerce: setting minimum purchase amount
Hello,
You can for example retrieve total price from current shopping cart and according this price allow/deny access for the user to move to the next step in shopping cart.
You can retrieve information about the total price from current shopping cart using the following code:
ShoppingCartInfo sci = CMS.CMSHelper.CMSContext.CurrentShoppingCart; sci.TotalPrice
After that you can decide whether user will be allowed to move to the next step for example in the method btnNext_Click() in ~\CMSEcommerce\ShoppingCart located in the ShoppingCart.ascx.cs file:
Example code:
ShoppingCartInfo sci = CMS.CMSHelper.CMSContext.CurrentShoppingCart; if ( sci.TotalPrice > some value){ this.CurrentStepControl.ButtonNextClickAction(); } else{ Label1.Text = "not allowed to continue"; }
To apply this just for one site, you need to add an additional condition where you will check the current site.
Best regards, Boris Pocatko
|