Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > e-commerce: setting minimum purchase amount View modes: 
User avatar
Member
Member
matt-4hilton - 11/9/2010 12:30:00 AM
   
e-commerce: setting minimum purchase amount
Hi all,

I want to make sure a customer purchase exceeds at 10 dollars, and if it is less than 10 dollars, to post an error message stating the minimum purchase order.

How would I do that without affected all the sites on my installation?

Thank you.

User avatar
Kentico Consulting
Kentico Consulting
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

User avatar
Member
Member
matt-4hilton - 11/10/2010 2:27:17 PM
   
RE:e-commerce: setting minimum purchase amount
Great! Thanks for the help.