Using custom providers

Top  Previous  Next

By default, Kentico CMS is delivered with sample custom providers with samples of method implementation. To include custom providers within your web project, please follow these steps:

 

1.Open your web project in Visual Studio 2005.
2.Copy the C:\Program Files\Kentico CMS\<version>\CodeSamples\CustomECommerceProvider directory to your working directory and add the project CustomECommerceProvider.csproj to your solution.
3.Remove all the references to the Kentico CMS libraries from the CustomECommerceProvider project and replace them with references to the corresponding DLL references from your web project /bin directory.
4.Delete the CMS.CustomECommerceProvider.dll file from the /bin directory of the CMS project.
5.Add the project reference to the CustomECommerceProvider project to your web project
6.Compile the solution.

 

Now your project is ready to use the custom providers. To enable custom providers, add following settings key to you web.config file:

 

<appSettings>

<add key="CMSUseCustomEcommerceProviders" value="true" />

</appSettings>

 

Since now, your web application will call your custom providers to handle the E-commerce requests. If you do not want to override the behaviour of certain methods, you should just call the CMS provider method to perform the original action. Original CMS providers are located in the CMS.CMSEcommerce namespace. See the next chapters to get the information about the providers and actions that they should perform in your methods to ensure the system consistency.

 

Every custom provider must implement a corresponding interface from the CMS.IECommerce namespace. For example: the CustomSKUInfoProvider implements the ISKUInfoProvider interface.

 

All providers use System.Object parameter types, so you need to type the method parameters to appropriate data types.

 

Please note: If you implement only some of the custom providers, you should ensure that your data are consistent with the other E-commerce database data. In case of inconsistency the system might not work well.

 

Additional information

 

If you need additional information on some class or database table structure, please see the Database Reference or API Reference documentation.