Question about "Product option"

Martin Shin asked on March 10, 2015 14:02

Hi. Is it possible to separate product option in transformations? I try to customize e-mail-template. And i want to see product option separately. I looked into K# and found "IsProductOption" condition only. But I don't know how to implement it.

From other side I looked into "E-commerce - Order_ContentTable" transformation. And found next string {%(IsProductOption) ? "  — " : ""%}{%Localize(SKUName)|(encode)%} And I see that this is script generates new table row with Qty, price and other attributes. All that I want to get is new column with product option name and nothing more.

What I should do for this?

Recent Answers

Zdeněk Cetkovský answered on July 6, 2015 12:58


Are you still looking for solution to this?

The product option name is stored the same way as with regular SKU objects - SKUName.
The mentioned macro expression puts the option name in the next row with indentation. If you wish to put it next to the original item, you would need to either modify the transformation result using some script, or you may need to put the option name information to the parent product row in the Content table, and put the name into custom column.
The principle of this approach can be found in sample custom provider in default installation, typically in c:\Program Files (x86)\Kentico\8.2\CodeSamples\App_Code Samples\E-commerce samples\CustomShoppingCartInfoProvider.cs as last customization named "Example: Adding custom SKU columns to shopping cart content table and displaying them on the invoice"

This way you could check in code whether given product has the option (you would need to go through all the shopping cart items and search for matching parent id and isProductOption flag) and optionally put the option item's SKUName into the custom column into given content table row.

Should you need any additional details, please feel free to ask.


0 votesVote for this answer Mark as a Correct answer

Martin Shin answered on July 6, 2015 15:44

Hi Zdenek. Thank you for answer. But I decided this question a month ago. Anyway, thank you.


0 votesVote for this answer Mark as a Correct answer

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