Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Custom Ecommerce Provider - Debugging Problem View modes: 
User avatar
Member
Member
str - 6/14/2011 6:28:52 AM
   
Custom Ecommerce Provider - Debugging Problem
Hy there,

i've got an problem and i don't really know whats wrong.
I've copied the CustomEcommerceProvider-Classes from the Blank-SampleCode to the App_Code-Folder and defined them in CMSCustom and also in web.config. If i now have a breakpoint in my CustomSKUInfoProvider Class the code only stops in 1 of maybe 15 cases. Is there any other option to set before a complete debugging is possible? I also deleted the Customspecific.Dll in the bin-Directory.

My web.config-Settings:
<add key="CMSUseCustomEcommerceProviders" value="true" />
<add key="CMSCustomEcommerceProviderAssembly" value="App_Code"/>

And here are my CMSCustom-Settings:
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.CustomAddressInfoProvider":
return new CMS.CustomECommerceProvider.CustomAddressInfoProvider();
case "App_Code.CustomCreditEventInfoProvider":
return new CMS.CustomECommerceProvider.CustomCreditEventInfoProvider();
case "App_Code.CustomCurrencyInfoProvider":
return new CMS.CustomECommerceProvider.CustomCurrencyInfoProvider();
case "App_Code.CustomCustomerInfoProvider":
return new CMS.CustomECommerceProvider.CustomCustomerInfoProvider();
case "App_Code.CustomDepartmentInfoProvider":
return new CMS.CustomECommerceProvider.CustomDepartmentInfoProvider();
case "App_Code.CustomDiscountCouponInfoProvider":
return new CMS.CustomECommerceProvider.CustomDiscountCouponInfoProvider();
case "App_Code.CustomDiscountLevelInfoProvider":
return new CMS.CustomECommerceProvider.CustomDiscountLevelInfoProvider();
case "App_Code.CustomExchangeRateInfoProvider":
return new CMS.CustomECommerceProvider.CustomExchangeRateInfoProvider();
case "App_Code.CustomExchangeTableInfoProvider":
return new CMS.CustomECommerceProvider.CustomExchangeTableInfoProvider();
case "App_Code.CustomInternalStatusInfoProvider":
return new CMS.CustomECommerceProvider.CustomInternalStatusInfoProvider();
case "App_Code.CustomManufacturerInfoProvider":
return new CMS.CustomECommerceProvider.CustomManufacturerInfoProvider();
case "App_Code.CustomOptionCategoryInfoProvider":
return new CMS.CustomECommerceProvider.CustomOptionCategoryInfoProvider();
case "App_Code.CustomOrderInfoProvider":
return new CMS.CustomECommerceProvider.CustomOrderInfoProvider();
case "App_Code.CustomOrderItemInfoProvider":
return new CMS.CustomECommerceProvider.CustomOrderItemInfoProvider();
case "App_Code.CustomOrderStatusInfoProvider":
return new CMS.CustomECommerceProvider.CustomOrderStatusInfoProvider();
case "App_Code.CustomOrderStatusUserInfoProvider":
return new CMS.CustomECommerceProvider.CustomOrderStatusUserInfoProvider();
case "App_Code.CustomPaymentOptionInfoProvider":
return new CMS.CustomECommerceProvider.CustomPaymentOptionInfoProvider();
case "App_Code.CustomPublicStatusInfoProvider":
return new CMS.CustomECommerceProvider.CustomPublicStatusInfoProvider();
case "App_Code.CustomShippingOptionInfoProvider":
return new CMS.CustomECommerceProvider.CustomShippingOptionInfoProvider();
case "App_Code.CustomShoppingCartInfoProvider":
return new CMS.CustomECommerceProvider.CustomShoppingCartInfoProvider();
case "App_Code.CustomShoppingCartItemInfoProvider":
return new CMS.CustomECommerceProvider.CustomShoppingCartItemInfoProvider();
case "App_Code.CustomSKUInfoProvider":
return new CMS.CustomECommerceProvider.CustomSKUInfoProvider();
case "App_Code.CustomSupplierInfoProvider":
return new CMS.CustomECommerceProvider.CustomSupplierInfoProvider();
case "App_Code.CustomTaxClassInfoProvider":
return new CMS.CustomECommerceProvider.CustomTaxClassInfoProvider();
case "App_Code.CustomVolumeDiscountInfoProvider":
return new CMS.CustomECommerceProvider.CustomVolumeDiscountInfoProvider();

}

return null;
}

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/14/2011 8:34:30 AM
   
RE:Custom Ecommerce Provider - Debugging Problem
Hi,

Could you please be more specific about what actions do you make when the breakpoint is hit so intermittently?
The code looks OK, the second key may not be even required, as Martin stated in discussion below his blogpost. By the way, have you checked the discussion? Feel free to ask there as well.

P.S. Please use code wrapper (using 4th icon) for longer code snippets, thanks.

Regards,
Zdenek

User avatar
Member
Member
str - 6/14/2011 8:56:32 AM
   
RE:Custom Ecommerce Provider - Debugging Problem
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?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/26/2011 7:58:05 PM
   
RE:Custom Ecommerce Provider - Debugging Problem
Hi,

Thanks for info.
Which version of Kentico CMS are you using?
What's the actual namespace for the SKUInfoProvider.GetSKUs(); call in the last snippet (of your custom App_Code/CustomECommerceProvider class)?

How often is the breakpoint hit? Have you found any pattern or is it completely random?

Thank you for any further info.
Zdenek