PIM product templates (in B2C, classes and templates) are created and maintained inside B2C and sent to PIM via the Synchronize setup data job. This synchronization should be run once to initialize the appropriate data structures in PIM, and afterwards, any time there is a change to B2C classes or templates.
How it Works
There are two types of templates that are synchronized from B2C to PIM: Product templates and variant templates. Each template has several properties for the product or variant (such as SKU, name and all custom properties for the specific product class).
- B2C Product templates inherit the base class “ProductContent”.
- B2C Variant templates inherit the base class “VariationContent”.
By default setup all product and variant template classes in B2C are synchronized to PIM during the PIM synchronization job. It is possible to exclude product and variant classes from being synchronized by decorating them with an attribute. It is generally recommended to create a template for each leaf level category in order to enforce proper data governance.
By contrast, all properties are excluded from sync by default and must be enabled on a per property basis using attributes. When a property has been enabled for sync, PIM will automatically create this property if it does not already exist in PIM and assign it to the specific product or variant template. If the property does exists inside PIM and is of the same type in both PIM and B2C then PIM will assign it automatically to the specific product or variant template. If the property exists inside PIM but is of a different type than B2C then PIM will not assign it and the user will have to map it separately.
How to Run the Sync Setup Job
The Sync Setup Job is configured in the B2C administration panel. Select "PIM: Synchronize setup data" and select the appropriate schedule.
- Active: Enable or disable the sync setup job.
- Scheduled job interval: Run the job every n intervals (seconds, minutes, hours, days, etc.) In most cases, sync setup jobs do not need to be run at specified intervals, and can be manually run only when changes to classes or properties are made in B2C.
- Next scheduled date: The date and time to start the next sync setup job. Click the elipses (...) to schedule a sync setup job.
Configuring Sync Attributes for B2C Classes and Properties
The B2C Setup Sync job normally runs in a completely automated fashion. All classes in B2C will automatically be synced to PIM and data types for any included properties will be converted from their native .NET data types into PIM data types. This behavior can be modified, however, by setting attributes on the relevant B2C classes or properties.
Controlling Sync Behavior with B2C Attributes
Below is a list of different attributes that can be used to control the integration between the B2C classes and PIM. These attributes must be added to classes within B2C.
Attribute name |
Applies to |
Description |
NoSync |
Product or variant classes |
Prevents a template class to be synchronized. |
Sync |
Properties in a product or variant class |
Synchronize the property over to PIM. Fields marked with the Sync property will automatically be read-only inside B2C. (needs verification if this is possible to do) |
CultureSpecific |
Properties in a product or variant class |
Built into B2C. Allows for translations of the specific field. |
Required |
Properties in a product or variant class |
Build into B2C. Marks a field as required. |
Recommended |
Properties in a product or variant class |
Builds into B2C. |
Data Type Compatibility
When syncing data between B2C and PIM, it is important to note that data type conversions will automatically be applied in order to map data appropriately. The following table explains the data type conversions that take place during sync:
B2C ASP.NET Type |
Maps to PIM type |
string |
Text field |
int |
Number |
bool |
Boolean |
N/A |
Text area |
N/A |
Radio button |
N/A |
Multiselect |
N/A |
Dropdown |
XHtmlString |
HTML |
N/A |
Date picker |
N/A |
Date/Time picker |