API
Version 7.x > API > Custom SKUInfo integration View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
wdaugherty-dataspringinc - 8/27/2013 2:44:07 PM
   
Custom SKUInfo integration
We are integrating the platform with a backend product management inventory systems for e-commerce using Kentico 7.0.28 and we are looking for a way to update SKUInfo data based on business rules that are implemented in the backend system. Fields that we need to update are things like SKUMinItemsInOrder, SKUInternalStatusID and a few others. We have been able to find the spot to update price but that is the only field that we have been able to update. Certain fields can be done using an async push which is not a problem to implement and we have done that but SKUMinItemsInOrder (and a few others) are dynamic based on what customer is signed in and the business agreements that were made with that customer. For instance customer A has to buy a min # of 5 for item 1234 per order and customer B has to buy a min of 10. We need this information to show on all screens that show product data such as a search page and item detail page and we want to use SKUMinItemsInOrder as a container so that all the built in logic is triggered. Are there any examples of what info provider and methods we need to override in order to achieve this customization?

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 8/28/2013 8:30:23 AM
   
RE:Custom SKUInfo integration
In regards to the integration, the Integration Bus was created just for this reason. I'm not saying it's the easiest thing to program/learn but it is pretty robust and works well once you figure it out.

I've also done 1 way pushes into kentico using custom tables and scheduled tasks. For instance if you have changes that happen on a regular basis you could write these records from your product management inventory system to a custom table within Kentico. Then create a scheduled task to run every N minutes/hours to process the records in Kentico and update the SKU information via the API.

In regards to the updating of the SKUMinItemsInOrder and other dynamic fields based on customer agreement. My guess is you will need some sort of linking table(s) like CustomerAgreements and Agreemenets. Agreements will have the defintiion of discounts, purchase requirements, etc. and the CustomerAgreements will have the simple IDs in them. There are global event handlers you can use to perform additional check, events, etc. You can also look at the E-Commerce guide and the Developers guide for custom providers. These should give you what you need for info to get started. I'd also suggest downloading the API documentation if you haven't already.

User avatar
Certified Developer v7
Certified  Developer v7
wdaugherty-dataspringinc - 8/28/2013 8:43:22 AM
   
RE:Custom SKUInfo integration
We have used the Integration Bus for tasks that it fit for such as communicating orders to the back end system, etc. But in this case the data is dynamic and can't be written to the underlying tables it just needs to be stored in memory. Our issue is finding which methods in the SKUInfoProvider (maybe that's no the right class to inherit from) to override so we can set the values appropriately after they are retrieved from the database but before they are used in various places. Unfortunately I have searched the documentations and have not been able to find any clue. Late yesterday I did find a method that is getting called GetSKUsInternal(...) and I set test values there but some other logic is taking place after that point and before it gets loaded into the data source for the repeater.

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 8/28/2013 8:58:09 AM
   
RE:Custom SKUInfo integration
Have you looked at the Developers guide for creating custom providers? It might be easier to create your own provider which would inherit some/most of the functionality as the SKUInfoProvider.

User avatar
Certified Developer v7
Certified  Developer v7
wdaugherty-dataspringinc - 8/28/2013 9:03:01 AM
   
RE:Custom SKUInfo integration
Yes, I have read through that and created custom providers. The question is which method to override. None of the ones that we have found that get called have any affect on the end result. We are currently overriding GetSkuPriceInternal in our custom provider and that is working fine and returning the desired price. We need to be able to over ride other values as well.

User avatar
Member
Member
Swainy - 9/3/2013 4:36:42 AM
   
RE:Custom SKUInfo integration
Hi,

You could override the GetSKUInfoInternal method and then set these values depending on x criteria rather than what is stored in the db.

Just ensure you first get the sku from the base so you all the default objects and values then override as you see fit.

i.e.
  protected override SKUInfo GetSKUInfoInternal(int skuId)
{
SKUInfo sku = base.GetSKUInfoInternal(skuId);
sku.SKUMinItemsInOrder = //Logic here
return sku;
}

Any questions shout,

Thanks,
Matt

User avatar
Certified Developer v7
Certified  Developer v7
wdaugherty-dataspringinc - 9/4/2013 11:45:04 AM
   
RE:Custom SKUInfo integration
Thank you for the suggestion but we have tried this and it does not get called until the item is added to the shopping cart. We need to be able to override the values for display on a detail page as well as on products listing page that uses a ProductDataList webpart to display a list of products under a certain node in the tree. We have actually overridden several methods in the SKUInfoProvider in an attempt to find the method that gets called with no success. Is there a different webpart that should be used instead of Product DataList?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 9/24/2013 10:11:38 PM
   
RE:Custom SKUInfo integration
Hi,

The ProductDataList (derived from DataList) loads the product data simply using the joined view (View_CMS_Tree_Joined), therefore your logic in the custom provider isn't called.
Have you considered using custom fields for SKU system table (Site manager -> Development-> System tables)? You could then display the given field in the transformations.
Otherwise, if there's a formula/ regular pattern how the values differ for given customer groups (levels), you could maybe add the logic to the listing webpart (ProductDataList) and alter the data during binding.

Were you able to find any acceptable solution to your requirement yet?

Regards,
Zdenek.

User avatar
Certified Developer v7
Certified  Developer v7
bsingh-visualantidote - 4/2/2014 10:45:06 AM
   
RE:Custom SKUInfo integration
Hi,

You can use basic repeater with Product document type OR custom Document type( extending product doc type ) and then play with the transformation by adding custom control in transformation of repeaters wherever you want and even call external source in transformation to display items on the fly if you are only concerned about displaying the data.
I have used it for manipulating different price rules and It works pretty well.
Regards