Commerce-Campaign integration: Cannot retrieve product name within Template Kit

  • Updated

EPiServer guides:


Issue description:

After successfully exporting catalog data from a Commerce website to Campaign server, users can import Commerce products into content interface paragraphs within Campaign Template Kit. However there's a chance that they cannot retrieve the actual product name for editing. The reason is described below:

- Campaign Editor can only edit these fields:
+ text1 - text10,
+ link1Text – link3Text,
+ link1Url – link3Url,
+ image1ImageUrl – image6ImageUrl,
+ image1AltText – image6AltText,
+ image1Link – image6Link,
+ additionalData1 – additionalData20.


- While the "Export Product Data To Campaign" job populates:
+ the name of the product to the "name" field in csv file
+ the category (product's parent) to the "text1" field





Product name needs to be populated in one of the fields those can be accessed by Campaign Editor users. Customer (partner) can override the IProductFieldsHandler, use other custom implementation to render the text fields, image fields, category fields... and additional data fields. How to make it work:

- Create a class (CustomProductFieldHandler.cs) inherits IProductFieldsHandler.
- Register the new implementation in the Initialization Module (SiteInitialization.cs).

services.AddSingleton<IProductFieldsHandler, CustomProductFieldHandler>();

- Deploy the code changes and run the "Export Product Data To Campaign" job

The result (EpiserverFoundationDemoCatalog_fixed.csv) and sample code files are attached to this article.