Product modelization from Akeneo to Salesforce

Summary

Akeneo DataModel & Customizations on the Product2 object

This document describes how Akeneo and Salesforce handle product attributes and variants. The above diagram depicts the Product2 data model for a model / parent and its variation in Akeneo. Below are some of the custom fields created on the Product2 object and their purposes:

  • Akeneo_Product_Type__c – picklist – Indicates whether a product is a model or a variation
  • Akeneo_UUID__c – string, external id, unique – stores unique Id for variants and name for models
  • Akeneo_Variant_Axes__c – textarea – contains comma-separated list of the model attributes for parent products and is NULL for variant products
  • Akeneo_Variant_Model__c – Product2 – For variant products this field contains the lookup to the Model product; otherwise, it is NULL

 

To display variations in a B2B Commerce store Salesforce uses a more complex data model. It uses the objects Product Attribute Set and Product Attribute Set Item to store a set of “variant axes”. Each set can be assigned to multiple variant parents (or models in Akeneo) using the object Product Attribute Set Product. To define the variant axis's actual value, the Product Attribute object is used, and in that object, a field for each axis must be created.

Akeneo DataModel substitutes to Standard Salesforce Object

The diagrams below illustrate how the model and its variant data are stored in the out-of-the-box Salesforce objects (highlighted in blue) and Akeneo data model (highlighted in purple).

The attribute of a Model (ex. Shirt size) which is used to distinguish its different variants is stored as shown below. In the standard Salesforce Model, we use 2 objects ProductAttributeSet and ProductAttributeSetProduct to store the attribute and link it to the parent model.

In Akeneo, we map these three objects directly onto the Product2 object by using an additional custom field called Akeneo_Variant_Axes__c, which holds the possible attribute values for a model. This field can also hold more than one attribute in a comma separated format (ex. shirt_size;color). This field is populated only on the models and not on the variant products.

The link between variant products and their model is established using another custom field on the Product2 object called Akeneo_Variant_Model__c. This is a lookup field containing the Salesforce Id of the model product. Naturally this field is empty for model products.

 

To link the attribute to the variant / child product, Salesforce uses a standard object called ProductAttribute. This object contains the Salesforce Ids of the model / parent product, its variants and the sequence in which they are to be displayed on the store.

To store the data related to the variant axes the connector uses an object called Akeneo_Variant_Axes_Detail__c with the following fields:

  • Variant_Attribute_Label__c – Label of the attribute
  • Variant_Attribute_API__c – API Name of the attribute
  • Variant_Attribute_Value__c – Label for the value that the attribute will carry
  • Variant_Attribute_Value_API__c – API for the attribute value mapped to the product
  • Variant_Attribute_Locale__c – Indicates the region for which this value is displayed, provides the ability to have different translations for the same value
  • Product__c – Salesforce Id of the variant product