Export Commerce Connect classes into PIM templates

  • Updated

Optimizely Commerce Connect 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 Commerce Connect classes or templates.

How it Works

The sync setup job synchronizes two types of templates from Commerce Connect 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 Commerce Connect 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 Commerce Connect, 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 Commerce Connect, 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 Commerce Connect 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 Commerce Connect.
  • 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 Commerce Connect sync setup job normally runs automatically. All classes in Commerce Connect 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 Commerce Connect classes or properties.

Controlling sync behavior with Commerce Connect attributes

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

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 Commerce Connect.

CultureSpecific

Properties in a product or variant class

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

Required

Properties in a product or variant class

Build into Commerce Connect. Marks a field as required.

Recommended

Properties in a product or variant class

Builds into Commerce Connect.

Data Type Compatibility

Syncing data between Commerce Connect 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:

Commerce Connect 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