Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Checkout process View modes: 
User avatar
Member
Member
Peter - 8/9/2009 11:55:12 PM
   
Checkout process
Hi,
we are setting up Ecommerce products on our website and some products are free. Is there a way to skip a checkout process (get credit card details) if the total of the order is 0?

Any help will be appreciated.
Thanks

User avatar
Kentico Support
Kentico Support
kentico_radekm - 8/12/2009 2:52:25 PM
   
RE:Checkout process
Hello.

Yes, there is a way how to achieve it. Basically, you will need to create your custom step in shopping process and follow this example from our E-commerce guide: http://devnet.kentico.com/docs/ecommerceguide/developing_custom_dialogs_for_.htm
In this example, there is check if the customer is in VIP role, and if yes, he is redirected to some other step, then by default. So, you can use the same logic, check ShoppingCartInfo object (CartItems) for free product and if found, redirect user to some next step and skip step, you do not want to use.

If you take a look on our example, in ButtonNextClickAction method you will see this condition:

if ((this.ShoppingCartInfoObj.UserInfoObj != null)

&& (this.ShoppingCartInfoObj.UserInfoObj.IsInRole("VipCustomers",

this.ShoppingCartInfoObj.SiteName)))

Here is checked if customer is registered and is a member of role "VipCustomers". You will only use your own condition (if the free product is in shopping cart).
If yes, you can use this code to redirect to requested step and skip the one you do not want to use:

// Load extra step for VIP customers which is not included
// in standard checkout process definition

ShoppingCartStep ctrl =

(ShoppingCartStep)this.Page.LoadControl("~/CMSEcommerce/ShoppingCart/MyVipStep.ascx");

this.ShoppingCartControl.LoadStep(ctrl);

Best Regards,
Radek Macalik