Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to add manufacturer name on the transformation View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 4/7/2011 9:41:46 PM
   
How to add manufacturer name on the transformation
Hi Guys,

Issue 1:
I would like to add the name of the Manufacturer in the transformation.

Adding the below works but I would like to have the name and not the ID:
<%# Eval("SKUManufacturerID") %>

Any ideas, on how to pull the manufacturer name?


Issue 2:
Can I make my own field in the document type and this new field automatically updates the manufacturer field?

Thanks
Gitesh Shah

User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 4/7/2011 10:05:40 PM
   
RE:How to add manufacturer name on the transformation
Also one more thing guys,

How can we change the text "Manufacturer" in the product filter webpart.
Just want to change the word Manufacturer on the frontend.

I went to webpart Layout but still can't find it.

Thanks
Gitesh Shah

User avatar
Member
Member
kentico_alleng - 4/8/2011 4:52:29 PM
   
RE:How to add manufacturer name on the transformation
Hi Gitesh,

For the first question, you can display the manufacturer name by using a custom function in your transformation. See the documentation here:

http://devnet.kentico.com/docs/5_5r2/devguide/index.html?adding_custom_functions_to_transformations.htm

In the function, you can use a SQL query to find ManufacturerDisplayName from the table COM_Manufacturer where the SKUManufacturerID for the product matches ManufacturerID in the COM_Manufacturer table.

For your second question, to change the display name for Manufacturer, follow these steps:

1. In the filesystem for your site, open this file:

./CMSResources/CMS.resx

2. Search the values for the string that matches the one you'd like to change. Note the key for that string (the name property of the data tag). In this case, you are most likely looking for objecttype.com_manufacturer or objecttype.ecommerce_manufacturer

3. Go to Site Manager -> Development -> UI culture and edit the culture you would like this string replaced for.

4. Choose new string, enter the key from above, and add your custom string to the textbox then save.

Best Regards,

Allen Greenhaw

User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 4/11/2011 10:37:56 PM
   
RE:How to add manufacturer name on the transformation
Hi Allen,

In the function, you can use a SQL query to find ManufacturerDisplayName from the table COM_Manufacturer where the SKUManufacturerID for the product matches ManufacturerID in the COM_Manufacturer table.

Can you please help me in writing a function. I can write the SQL query but now sure how it will go in C#. Sorry but I am not very good in C#.

Thanks
Gitesh Shah

User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 4/11/2011 11:04:44 PM
   
RE:How to add manufacturer name on the transformation
not the whole code allen, but just some example might be great....

User avatar
Member
Member
kentico_alleng - 4/13/2011 12:05:05 PM
   
RE:How to add manufacturer name on the transformation
Actually, I've got an easier approach for you.

You still want to create a custom function as described in the documentation. Instead of the example "TrimText", create the following method:


public static string GetManufacturerName(object SKUManufacturerID)
{
if (SKUManufacturerID == null | SKUManufacturerID == DBNull.Value)
{
return "";
}
else
{
CMS.Ecommerce.ManufacturerInfo mi = CMS.Ecommerce.ManufacturerInfoProvider.GetManufacturerInfo(Convert.ToInt32(SKUManufacturerID));
return mi.ManufacturerDisplayName.ToString();

}
}


Regards,

Allen