Export Customized Commerce classes into PIM templates

  • Updated

Optimizely Customized Commerce allows you to sync your catalog name, product classes, and templates into Optimizely Product Information Management (PIM) with a synchronize setup data job. This synchronization job should be run once during implementation to initialize the appropriate data structures in the PIM and any time after when you change Customized Commerce classes or templates.

How it Works

The sync setup job synchronizes two types of templates from Customized Commerce to the 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).

  • Product templates inherit the base class ProductContent.
  • Variant templates inherit the base class VariationContent.

By default, the sync setup job synchronizes all product and variant template classes in Customized Commerce to the PIM. Exclude product and variant classes from synchronization by decorating them with the PimNoSync attribute. You should create a template for each leaf level category to enforce proper data governance. See Define category trees and categories in Optimizely Product Information Management for product category design best practices.

However, the sync setup job excludes all properties by default, and any properties you want to be synchronized must be enabled individually using the PimSync attribute. If a property is enabled for synchronization, the PIM automatically creates this property if it does not already exist in the PIM and assigns it to the specified product or variant templates. If the property does exist inside the PIM and is of the same type in both the PIM and Customized Commerce, then the PIM assigns it automatically to the specified product or variant template. If the property exists inside the PIM but is of a different type than Customized Commerce, then the PIM will not assign it, and you must map it to its associated templates separately.

Run the sync setup job

The sync setup job is configured in the Customized Commerce administration panel.

  1. Click PIM: Synchronize setup data.
  2. Check Activate to enable the sync setup job.
  3. Select an appropriate schedule to run the job.

PIM-Sync_Setup_Data.png

There are two ways to schedule the sync setup job: by setting a recurrence interval or entering a specific time to run the job.

  • Scheduled job interval – Use this input to configure a recurrence interval. This runs the job every intervals (seconds, minutes, hours, days, and so on) as specified. In most cases, sync setup jobs do not need to be run often and can be manually run only when changes to classes or properties are made in Customized Commerce.
  • Next scheduled date – Use this input to select a specific date and time to run the job once. Click the ellipses to pick a date/time to run the job, such as in the next minute.

Configure sync attributes for classes and properties

The Customized Commerce sync setup job normally runs automatically. All classes in Customized Commerce will automatically be synced to the PIM, and data types for any included properties will be converted from their native .NET data types into the PIM data types. This behavior can be modified, however, by setting attributes on the relevant Customized Commerce classes or properties.

Controlling sync behavior with Customized Commerce attributes

Below is a list of different attributes that can be used to control the integration between the Customized Commerce classes and the PIM. These attributes must be added to classes within Customized Commerce.

Attribute name Applies to Description

PimNoSync

Product or variant classes

Prevents a template class to be synchronized.

PimSync

Properties in a product or variant class

Synchronize the property over to the PIM. Fields marked with the Sync property will automatically be read-only inside Customized Commerce.

CultureSpecific

Properties in a product or variant class

Built into Customized Commerce. Allows for translations of the specific field.

Required

Properties in a product or variant class

Build into Customized Commerce. Marks a field as required.

Recommended

Properties in a product or variant class

Builds into Customized Commerce.

Data Type Compatibility

Syncing data between Customized Commerce and the PIM automatically applies the data type conversions to map data appropriately. The following table explains the data type conversions that take place during the sync:

Customized Commerce ASP.NET Type Maps to the PIM type

string

Text field

int

Number

bool

Boolean

LongString

Text area

DictionarySingleValue, EnumSingleValue

Radio button

DictionaryMultiValue, EnumMultiValue

Multiselect

DictionarySingleValue, EnumSingleValue

Dropdown

XHtmlString

HTML

Date

Date picker

DateTime

Date/Time picker