ASPX templates
Version 6.x > ASPX templates > Custom Product Header View modes: 
User avatar
Member
Member
rmshearer83-gmail - 7/18/2013 3:25:25 AM
   
Custom Product Header
Hello, I am currently working on an ecommerce website from aspx templates and I am trying to customise this article: http://devnet.kentico.com/Knowledge-Base/E-commerce/Products-import-from-external-source.aspx

I have created a product header webpart and I would like to tell the import to create these headers underneath the product page based on the deparment name of the products

can anybody give me any advice on how to do this?
any help would be much appreciated

thanks

Rachel

User avatar
Kentico Support
Kentico Support
kentico_filipl - 7/21/2013 7:34:27 AM
   
RE:Custom Product Header
Hello Rachel,

Are these headers fields of those products you want to import? If so, you can create them based on SKUDepartmentID property of SKUInfo object which is created in the following part of the code:
// Get product data
string[] productData = line.Trim().Split(',');

// Create product (SKU)
SKUInfo sku = new SKUInfo();
sku.SKUName = productData[0];
sku.SKUDescription = productData[1];
sku.SKUPrice = ValidationHelper.GetDouble(productData[2], 0);
sku.SKUEnabled = true;
sku.SKUSiteID = siteId;
sku.SKUProductType = SKUProductTypeEnum.Product;

DepartmentInfo department = DepartmentInfoProvider.GetDepartmentInfo(productData[3], siteName);
if (department != null)
{
// Assign product to its department
sku.SKUDepartmentID = department.DepartmentID;
}

Best regards,
Filip Ligac