MY Intention is to extend the SKU-Datatable and i thought to do it like this.
Define the App-Settings in web.config:
<add key="CMSUseCustomEcommerceProviders" value="true" />
<add key="CMSCustomEcommerceProviderAssembly" value="App_Code"/>
Then extend the CMSCustom-Class:
public static object GetCustomClass(string className)
{
// Provide your custom classes
switch (className)
{
// Define the class MyTask implementing ITask and you can provide your scheduled tasks out of App_Code
case "Custom.MyTask":
return new MyTask();
case "App_Code.CustomSKUInfoProvider":
return new CMS.CustomECommerceProvider.CustomSKUInfoProvider();
}
return null;
}
And create a Class called CustomSKUInfoProvider under App_Code/CustomECommerceProvider with Functions like this.
/// <summary>
/// Return all products
/// </summary>
public DataSet GetSKUs()
{
return SKUInfoProvider.GetSKUs();
}
/// <summary>
/// Retrun all SKUs selected with where condition and ordered by "orderBy" parametr
/// </summary>
/// <param name="where">Where condition</param>
/// <param name="orderBy">Order by clause</param>
public DataSet GetSKUs(string where, string orderBy)
{
return SKUInfoProvider.GetSKUs(where, orderBy);
}
If i set a breakpoint inside GetSKUs(string where, string orderBy) and click on the Products-Page in my site in most cases the code won't stop here.
Is there sometihing that i have forgotten?