Skip to main content

Fetching families and attributes from Akeneo

In Alumio, go to “Integrations → Incoming → Akeneo - Fetch - Families and Attributes”. We need to send attribute definitions from Akeneo into Magento 2. We will sync this by mapping the Akeneo family into the Magento 2 attribute set, and then we map the Akeneo attribute into the Magento 2 attribute. To do so, use the Incoming “Akeneo - Fetch - Families and Attributes” to get data from the Akeneo Server.
Image
This incoming will create a task inside Alumio with data structured as the Alumio base family. There is a transformer inside the Incoming before processing this family:
  • Akeneo - Fetch and convert - Family attributes into Alumio Base attributes.
  • Akeneo - Filter previous - Family.
Akeneo - Fetch and convert - Family attributes into Alumio Base attributes This transformer will fetch the attributes data inside a family, then convert them into Alumio Base attributes. The step inside this transformer is as follows:
  1. It is called the transformer “Akeneo - Fetch and update storage - Family Variants - Axes” to determine the super attribute that would translate to an attribute that is required and is filterable in Magento 2.
  2. It will transform the family structure into Alumio Base by calling the transformer “Akeneo - Prepare convert - Labels - To localizations” and “Akeneo - Convert - Family to Alumio Base”.
  3. After we convert the family, we need to get the attribute data that is attached to this family. We do it by:
    • “Akeneo - Fetch - Attribute by code” –– this transformer will fetch the attribute data from Akeneo.
    • “Akeneo - Prepare convert - Labels - To localizations” –– this transformer will prepare the labels in Alumio Base.
    • “Akeneo - Check and fetch - Attribute options” –– this transformer will fetch the options from the attribute options when the attribute type is a simple select or a multiselect. This transformer will fetch the options from the entity records when the attribute type is reference entity or reference entity collections.
    • “Akeneo - Convert - Attribute - To Alumio Base Attribute” –– this transformer will convert the attribute structure into Alumio Base.
    • “Akeneo - Map - Type code - To Alumio Base code” –– this transformer will convert the attribute code value into Alumio Base.
    • “Akeneo - Check - Axes - Is Super Attribute” –– this transformer checks the super attribute using storage Akeneo - Family Variants - Axes created earlier at “Akeneo - Fetch and update storage - Family Variants - Axes”.
Akeneo - Filter previous - Family. This transformer filters Alumio base families with attributes from the previous iteration to avoid duplication.

Fetching Product Types from Magento 2

In Alumio, go to “Integrations → Incoming → Magento 2 - Fetch - Attributes.” Magento 2 stores have default attributes that can cause issues during attribute synchronization. To prevent duplication of attributes with the same code, we first fetch the existing attributes from the Magento 2 system. This Incoming directly stores the attribute data in Alumio, allowing us to update it during synchronization from Akeneo.
Image
Magento - Save - Attribute Id.
Save the Magento 2 ID based on the attribute code to make it possible to update data from Akeneo.

Sending Attribute Sets and Attributes into Magento 2

In Alumio, go to “Integrations → Route → Synchronize Akeneo Families and Attributes to Magento 2 Attributes Sets and Attributes”. Then go to the outgoing “Magento 2 - Send - Attribute Sets and Attributes”. This Outgoing will transform the Alumio base families and attributes into Magento 2 attribute sets, attribute groups and attributes. It will also check the previous iteration to determine whether to create or update. Here is a list of transformers inside the described Outgoing to send:
  1. Magento 2 - Convert - Attributes from Alumio Base Family
  2. Magento 2 - Check and Send - Attributes from family with separate Options Send
  3. Magento 2 - Convert - Attribute set from Alumio family
  4. Magento 2 - Check and send - Attribute set
  5. Magento 2 - Prepare send - Attribute Set Group
  6. Magento 2 - Send - Attribute Set Group
  7. Magento 2 - Prepare send - Attributes Assign to Attribute Set
  8. Magento 2 - Send - Attributes Assign to Attribute Set.
Magento 2 - Convert - Attributes from Alumio Base Family.
Convert attributes and attribute options inside the Alumio Base into the Magento 2 Attribute payload.
Image
Magento 2 - Check and Send - Attributes from family with separate Options Send.
This will sync the attribute and each attribute option. An example of the Magento 2 attribute payload looks as follows:
{
  "attribute": {
    "scope": "global",
    "is_unique": 0,
    "is_visible": 1,
    "is_required": 0,
    "is_comparable": 1,
    "is_searchable": 1,
    "attribute_code": "smartwatch_brands",
    "frontend_input": "select",
    "is_user_defined": 1,
    "is_visible_on_front": 1,
    "default_frontend_label": "Smartwatch brands"
  }
}
An example of the Magento 2 attribute option payload looks as follows:
{
  "option": {
    "label" : "Garmin"
  }
}
Magento 2 - Convert - Attribute set from Alumio family.
This transformer will convert the Alumio family into the Magento 2 attribute set payload. We set the entity type ID and skeleton ID to the default 4.
Image
Magento 2 - Check and send - Attribute set.
This transformer creates or updates the attribute set.
Image
Magento 2 - Prepare send - Attribute Set Group.
This transformer prepares the attribute set group payload based on the attribute set.
Image
Magento 2 - Send - Attribute Set Group.
This transformer creates the attribute set group if none is created.
Image
Magento 2 - Prepare send - Attributes Assign to Attribute Set.
This transformer creates the payload to assign attributes to the attribute set and attribute set group.
Image
Magento 2 - Send - Attributes Assign to Attribute Set.
This transformer assigns the attribute to the attribute set and the attribute set group.
Image

Automatic Attribute Sets and Attributes Synchronization Setup

  • Go to “Integrations → Schedulers → Akeneo - Fetch - Families and Attributes”.
    Image
  • Set a schedule expression and enable the configuration.
  • Go to “Integrations → Schedulers → Magento 2 - Send - Attribute Sets and Attributes”.
    Image
  • Set a schedule expression and enable the configuration.