E-commerce customization

Post on 13-Jan-2015

3.196 views 1 download

Tags:

description

KENTICO CONNECTION SESSIONIn 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.

Transcript of E-commerce customization

E-commerce customizationPetr Vozak, Technical Leader

E-commerce customization

Agenda1) Using custom e-commerce providers2) Developing custom dialog for the checkout process3) Developing custom payment gateway

E-commerce customization

1) Using custom e-commerce providers

Using custom e-commerce providers

How doest it work?

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

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

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

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”>

Using custom e-commerce providers

DEMO1) How to customize shipping calculation

– customize CalculateShipping()

2) How to automatically set some credit to a new customer– Customize SetCustomerInfo()

E-commerce customization

2) Developing custom dialog for the checkout process

Developing custom dialog for the checkout process

Developing custom dialog for the checkout process

DEMO1) Create checkout process step user control (*.ascx)• inherit from ShoppingCartStep• override bool IsValid()• override bool ProcessStep()

2) Register checkout process step

E-commerce customization

3) Developing custom payment gateway

Developing custom payment gateway

Developing custom payment gateway

DEMO1) Create payment gateway form• inherit from CMSPaymentGatewayForm• override bool ValidateData()• override bool ProcessData()

2) Create payment gateway provider• inherit from CMSPaymentGatewayProvider• override void GetPaymentDataForm()• override bool ProcessPayment()

3) Register payment gateway

E-commerce customization

Summary1) Using custom e-commerce providers2) Developing custom dialog for the checkout process3) Developing custom payment gateway