KENTICO CONNECTION SESSION
In this session, we will show you the basics of the E-commerce customization. You will see E-commerce customization model and you will learn how to use custom e-commerce providers, how to customize ordering steps, how to create new payment gateway, what’s new in E-commerce 6.0 and more.
5. Using custom e-commerce providers
• Assembly: CMS.Ecommerce
• Namespace: CMS.Ecommerce
• Provider: ShippingOptionInfoProvider
• Method: CalculateShipping(…)
public static double CalculateShipping(ShoppingCartInfo cartObj, string siteName)
{
if (ECommerceHelper.UseCustomHandlers())
{
return ECommerceHelper.GetShippingOptionInfoProvider().CalculateShipping(cartObj, siteName);
}
else
{
return CMS.CMSEcommerce.ShippingOptionInfoProvider.CalculateShipping(cartObj, siteName);
}
}
Are custom e-commerce providers enabled?
YES → Run custom code
NO → Run Kentico code
Wrapper
6. Using custom e-commerce providers
• Assembly: CMS.Ecommerce
• Namespace: CMS.CMSEcommerce
• Provider: ShippingOptionInfoProvider
• Method: CalculateShipping(…)
public static double CalculateShipping(ShoppingCartInfo cartObj, string siteName)
{
// if shipping free limit is reached -> return zero (shipping is free)
// else -> return shipping option value
}
Here is Kentico logic for
shipping calculation,
something like:
Kentico code
7. Using custom e-commerce providers
• Assembly: CMS.CustomECommerceProvider
• Namespace: CMS.CustomECommerceProvider
• Provider: CustomShippingOptionInfoProvider
• Method: CalculateShipping(…)
public double CalculateShipping(object cartObj, string siteName)
{
return CMS.CMSEcommerce.ShippingOptionInfoProvider.CalculateShipping(
(CMS.Ecommerce.ShoppingCartInfo)cartObj, siteName);
}
Kentico method is called by default
Custom code
8. Using custom e-commerce providers
1) Open Visual Studio and add CustomECommerceProvider
project from code samples to your CMS solution
2) Modify code of the custom e-commerce providers to
reach your requirements
3) Add the following key to your web.config file to enable
custom e-commerce providers:
<add key=“CMSUseCustomEcommerceProviders” value=“true”>
9. Using custom e-commerce providers
DEMO
1) How to customize shipping calculation
– customize CalculateShipping()
2) How to automatically set some credit to a new customer
– Customize SetCustomerInfo()
12. Developing custom dialog for the checkout process
DEMO
1) Create checkout process step user control (*.ascx)
• inherit from ShoppingCartStep
• override bool IsValid()
• override bool ProcessStep()
2) Register checkout process step