Category
Changed on:
13 Dec 2023
Overview
The Category Module is responsible for synchronizing categories from Adobe Commerce to Fluent.
Key features:
- Manually synchronize the entire categories at any time using the CLI command.
- Automatic detection and synchronization of modified categories.
- Multi-retailer / multi-website configuration support.
Detailed Technical Description
Sync types
There are three types of synchronization available
- Magento CLI command
- Adobe Admin console
- Automatically by the system
Although they are initiated differently, they use the same flow as described below. Categories are added to Adobe’s message queue and a dedicated message consumer will handle the message and export the data to Fluent.
Magento CLI
Executed manually from the Magento CLI and it is recommended to be used right after module installation to export all the categories into Fluent. It adds all categories into the message queue for a full initial load on Fluent.
`bin/magento fluent:category_full:push`
Admin Console
Use this option to synchronize categories manually. The number of categories pushed will depend on the date selected. The extension will look for categories that have been modified from the date specified up to the moment the synchronization starts running.
Automatic Delta Sync
This is an automated synchronization that runs in the background to keep Fluent up to date. This synchronization is based on the Adobe Commerce cron job that looks for categories changed since the last synchronization.
Payload Building
A builder pattern is used to build API payloads for each category to be synchronized: class
`FluentConnector`
`Category/Model/Request/BuildCategoryPayload.php`
`FluentConnector`
`Category/Model/Request/Data/Collector/Category.php`
Category Events
List of events that allows category payload modification without overwriting classes.
Name | Description | Parameters |
fluent_send_category_data_prepare_before | Allows customization of category collection to be sent | collection |
fluent_send_category_data_prepare_after | Allows customization of a payload of a specific category | category_info of type array |
fluent_send_categories_before | Event before categories are pushed to Fluent | categoryIds of type array |
fluent_send_categories_after | Event after categories are successfully pushed to Fluent | categoryIds of type array |