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.
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. Add the following references from your web project /bin directory:
• | CMS.CMSHelper.dll |
• | CMS.DataEngine.dll |
• | CMS.Ecommerce.dll |
• | CMS.GlobalHelper.dll |
• | CMS.IECommerce.dll |
• | CMS.SettingsProvider.dll |
• | CMS.SiteProvider.dll |
• | CMS.Staging.dll |
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.
Page url: http://devnet.kentico.com/docs/5_5r2/ecommerceguide/index.html?using_custom_providers.htm