Get the value of custom product page type fields in Shoppingcartcontent web part transformation

Iman Emran asked on February 20, 2016 11:39

Hi,

I have custom page type in E-commerce site which called Product - Shoes and in Fields section of this page type, I've added some custom fields for example ShoeSize which is stored in dbo.STORECONTENT_Shoes table.

In transformation of Shopping cart content web part I can only access default SKU fields like <%# SKU.SKUName %>

Now how can I get value of custom fields in dbo.STORECONTENT_Shoes in transformation of Shoppingcartcontent web part?

Thanks

Correct Answer

Joshua Adams answered on February 22, 2016 21:55

What david is saying is that the product options and variants can be used instead of creating a custom product page type. A page type could work, but as noted, you need to write a query or find a way to couple that data. Why not piggy back on what Kentico has already created and add the shoe color and style as product options on a product named shoe. Seems like that is way simpler and using Kentico how it is meant to be used. Plus, Kentico has webparts which will show the product options and can be included easily in transformations.

Product options can also be attached on other similar products, which means they can be reused. You could also attach multiple options to the same product and use variants as well.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on February 20, 2016 23:54

Try either one of these <%# Eval("CustomFieldName") %> or <%# SKU.GetValue("CustomFieldName") %>

0 votesVote for this answer Mark as a Correct answer

Iman Emran answered on February 21, 2016 07:19

Hi Brenden,

If you carefully read my question I said that I want to get the value of custom field for example ShoeSize which is saved in dbo.STORECONTENT_Shoes table not in dbo.COM_SKU.

So in shoppingcartcontent webpart I can only access the fields of dbo.COM_SKU.

For second time my question is how can I get the value of custom fields which is stored in dbo.STORECONTENT_Shoes in transformation of Shoppingcartcontent web part?

thanks

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on February 22, 2016 00:11

Hi Iman,

In theory a SKU could be connected to multiple documents. You could create something custom to get a document with the same SKU ID (it should have this property stored in the 'NodeSKUID' column).

However, I'm wondering why isn't this property part of the SKU itself? If there are multiple options you could use Options or even Variants function of Kentico.

Greets,

David

1 votesVote for this answer Mark as a Correct answer

Iman Emran answered on February 22, 2016 06:57 (last edited on February 22, 2016 07:45)

Hi David,

Now what is the best way to get data of a page type like Product.Shoes in a transformation which only has SKU data?

I think that it doesn't make sense to add all the custom product fields in COM_SKU table. There is sample page types in Kentico sample site which called E-commerce Site and you can see them. I have several products and for each of them I have created a new page type.

Image Text

Image Text

Image Text Shoppingcartcontent web part transformation

0 votesVote for this answer Mark as a Correct answer

Iman Emran answered on February 23, 2016 15:24

Thank you Joshua, I solved it.

Best regards

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.