VOOZH about

URL: https://deepwiki.com/MahoCommerce/maho/13.3-feed-manager

⇱ Feed Manager | MahoCommerce/maho | DeepWiki


Loading...
Last indexed: 15 May 2026 (ea8ab8)
Menu

Feed Manager

The Feed Manager is a native Maho module designed to automate the generation and distribution of product data feeds to third-party platforms (e.g., Google Shopping, Facebook, Pinterest). It provides a flexible architecture for mapping internal catalog attributes to platform-specific requirements, applying filtering rules, and scheduling automated deliveries via various protocols.

System Architecture

The Feed Manager operates as a standalone engine within the Maho ecosystem, leveraging the EAV catalog structure to extract data and transform it into structured formats (XML, CSV, TXT).

Core Components

ComponentClass / EntityResponsibility
Feed ModelMaho_FeedManager_Model_FeedPrimary entity containing configuration, file format, and execution logic.
Dynamic RuleMaho_FeedManager_Model_DynamicRuleSupports multiple condition→output cases with first-match-wins evaluation app/code/core/Maho/FeedManager/Model/DynamicRule.php35-36
DestinationMaho_FeedManager_Model_DestinationHandles delivery settings (SFTP, FTP) with encrypted credentials.
GeneratorMaho_FeedManager_Model_GeneratorOrchestrates the collection loading and file writing process.
Platform PresetsMaho_FeedManager_Model_Platform_*Platform-specific logic for Bing, Facebook, Google, and Pinterest.

Sources: app/code/core/Maho/FeedManager/Model/DynamicRule.php35-36 app/code/core/Maho/FeedManager/Model/Platform/Bing.php1 app/code/core/Maho/FeedManager/Model/Platform/Facebook.php1

Data Flow: Feed Generation

The following diagram illustrates the lifecycle of a feed generation request, from the CLI or Cron trigger to the final delivery.

Feed Generation Pipeline


Sources: app/code/core/Maho/FeedManager/Model/DynamicRule.php82-100 app/code/core/Mage/Core/Helper_Data.php65-78

Dynamic Rules and Attribute Mapping

Maho introduces a powerful Dynamic Rule system app/code/core/Maho/FeedManager/Model/DynamicRule.php14-16 that allows for complex logic when determining attribute values for feeds.

Case-Based Evaluation

Rules support multiple "cases" where the first case to match the product's conditions determines the output value app/code/core/Maho/FeedManager/Model/DynamicRule.php175-193

Condition Engine

Dynamic rules utilize the standard Maho rule engine app/code/core/Maho/FeedManager/Model/DynamicRule.php82-99 Conditions are loaded into a Maho_FeedManager_Model_Rule_Condition_Combine instance for evaluation app/code/core/Maho/FeedManager/Model/DynamicRule.php88-95

Dynamic Rule Logic Flow


Sources: app/code/core/Maho/FeedManager/Model/DynamicRule.php138-162 app/code/core/Maho/FeedManager/Model/DynamicRule.php175-193

Category Mapping

Feed Manager allows mapping internal store categories to platform-specific taxonomies (e.g., Google Product Category). This is managed via the Maho_FeedManager_Adminhtml_Feedmanager_CategoryController app/code/core/Maho/FeedManager/controllers/Adminhtml/Feedmanager/CategoryController.php1

The mapping logic is handled by Maho_FeedManager_Model_Mapper, which translates internal category IDs into the target platform's required string format app/code/core/Maho/FeedManager/Model/Mapper.php1

Sources: app/code/core/Maho/FeedManager/controllers/Adminhtml/Feedmanager/CategoryController.php1 app/code/core/Maho/FeedManager/Model/Mapper.php1

Destinations and Security

The delivery of generated files to remote servers is handled by the destination model.

Credential Protection

Delivery configurations (host, username, password, private keys) are protected using Maho's core encryption system.

  1. Encryption: Data is encrypted using Mage_Core_Model_Encryption app/code/core/Mage/Core/Helper/Data.php65-78
  2. Decryption: When retrieved, the system uses the configured encryption model (Sodium by default) to decrypt credentials.
  3. Key Management: Keys are stored in app/etc/local.xml and can be regenerated via CLI, which triggers the encryption_key_regenerated event to re-encrypt existing data lib/MahoCLI/Commands/SysEncryptionKeyRegenerate.php126-130

Sources: app/code/core/Mage/Core/Helper/Data.php65-78 lib/MahoCLI/Commands/SysEncryptionKeyRegenerate.php57-61 lib/MahoCLI/Commands/SysEncryptionKeyRegenerate.php126-130

CLI Commands

The Feed Manager provides a set of Symfony-based commands for manual execution and debugging. These commands are integrated into the Maho CLI framework via command discovery.

Command List

CommandResponsibility
feed:generateGenerates a specific feed by ID.
feed:generate:allIterates through all enabled feeds and triggers generation.
feed:listDisplays a table of all configured feeds, status, and last run.
feed:validateValidates feed configuration and destination connectivity without file writing.

Sources: lib/MahoCLI/Commands/SysEncryptionKeyRegenerate.php24-28 (Pattern for CLI command definition)

Scheduling

Feeds are scheduled using the Maho Cron system. The Maho_FeedManager_Model_Observer handles automated triggers based on defined schedules app/code/core/Maho/FeedManager/Model/Observer.php1

Scheduling Entity Mapping


Sources: app/code/core/Maho/FeedManager/Model/Observer.php1 app/code/core/Maho/FeedManager/Model/DynamicRule.php35-36