# magendoo/module-omnibus

> EU Omnibus Directive (2019/2161) price tracker for Magento 2. Records price changes with timestamps, computes the lowest prior price in the disclosure window, and displays it on PDP and PLP, with async queue processing for bulk operations.

`composer require magendoo/module-omnibus`

Canonical URL: https://packagento.com/magendoo/module-omnibus

## At a glance

- **Vendor**: magendoo (https://packagento.com/magendoo.md)
- **Latest version**: 2.0.1 — released 2026-07-20
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/magendoo/module-omnibus and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require magendoo/module-omnibus:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

EU Omnibus Directive (2019/2161) price tracker for Magento 2. Records price changes with timestamps, computes the lowest prior price in the disclosure window, and displays it on PDP and PLP, with async queue processing for bulk operations.

## README

A Magento 2 module that records product price history and computes the lowest price in a configurable window, satisfying the requirements of the **EU Omnibus Directive 2019/2161 (Article 6a)**.

The directive requires that any price reduction must show the lowest price from the preceding 30 days — measured not from today, but from the moment the reduction began. This module implements that anchored-window algorithm correctly.

---

### Requirements

| Dependency | Version |
|---|---|
| PHP | ≥ 8.1 |
| Magento Open Source / Adobe Commerce | 2.4.4 – 2.4.x |
| MySQL / MariaDB | 8.0 / 10.6+ |

No RabbitMQ required: all queue topics are pinned to Magento's MySQL-backed `db` queue connection (`queue_message` table), so the async pipeline works on any standard Magento installation. Consumers run through Magento cron (`consumers_runner`) or a process manager — see [Async processing](#async-processing).

---

### Installation

The module is distributed via its GitHub repository (it is **not** published on Packagist).

#### Via Composer (recommended)

Add the repository to your project's `composer.json`:

```json
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/magendooro/module-omnibus"
    }
]
```

Install and enable:

```bash
composer require magendoo/module-omnibus:^2.0
bin/magento module:enable Magendoo_Omnibus
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

#### Manual installation

Copy the module directory to `app/code/Magendoo/Omnibus/`, then run the same `setup:upgrade` / `setup:di:compile` / `cache:flush` sequence.

---

### Quick Start

After installation, navigate to:

> **Stores → Configuration → Magendoo Extensions → Omnibus Price Tracker**

1. Set **Enable Price History** to **Yes**
2. Set **Period in Days** to **30** (minimum required by the Directive; increase for a wider safety margin)
3. Set **Display Mode** to **Discounted Products Only** (recommended for compliance)
4. Set **Display Omnibus Prices On** to **Product Pages Only** or **Product and Category Pages** — the default is **None**, which records history but renders nothing on the storefront
5. Click **Save Config** → the module queues a full catalog recompute on the `magendoo.omnibus.recompute` queue (make sure consumers are running)
6. Seed an initial baseline so products have history to compute from:

```bash
bin/magento omnibus:history:restore --force
```

The `omnibus_price` product attribute is then populated and the label renders on the configured surfaces.

---

### Configuration Reference

`general/*` settings are scoped per website. `label/*` settings are scoped per **store view** so the label can be translated for each language (store view is Magento's locale boundary); an untranslated store view inherits the website/default value. `cleanup/*` and `cron/*` are global.

| Path | Default | Description |
|---|---|---|
| `general/enabled` | No | Master toggle. Disabling stops capture and display but does not delete existing history. |
| `general/period_in_days` | 30 | Window length in days. Hard minimum: 30 (enforced at save time and again at read time). |
| `general/display_mode` | `discounted_only` | `discounted_only` — show only during active reductions. `all_products` — show for all products (rolling window). |
| `general/display_on` | `none` | Where to render the label: `none`, `pdp_only`, or `pdp_and_plp`. Must be changed from the default for any storefront output. |
| `general/hide_if_matches` | Yes | Suppress the label when the Omnibus price equals the current price. |
| `general/show_history_on_product` | No | Adds a notice on the admin product edit page pointing to the price history grid. |
| `general/hide_for_customer_groups` | *(none)* | Suppress the label for specific customer groups (history is still recorded). |
| `label/template` | `The lowest price from the last {days} days: {omnibus_price}` | Label text. Variables: `{days}`, `{omnibus_price}`, `{percentage}`. Allowed HTML tags: `span i u b strong em`. |
| `label/display_format` | `text` | `text` (inline) or `tooltip`. |
| `label/percentage_difference` | `disabled` | Show % change between current price and Omnibus price via `{percentage}`. |
| `cleanup/enabled` | Yes | Automatic deletion of old history records by the cleanup cron. |
| `cleanup/period_in_days` | 400 | Delete records older than this many days. Must be ≥ `period_in_days + 30`. The newest pre-cutoff record per product/website/group is always kept (carry-in). |
| `cron/sync_schedule` | `0 2 * * *` | Drift-sync cron: queues captures for products whose current effective price (rule / active special / regular) drifted from the last history entry. |
| `cron/cleanup_schedule` | `0 3 * * *` | Cleanup cron: deletes records older than the retention window. |

All `recorded_at` timestamps are stored in **UTC**.

---

### CLI Commands

All three commands refuse to run (exit non-zero) while `magendoo_omnibus/general/enabled` is `0`.

```bash
## Recompute omnibus_price for all products on all websites
bin/magento omnibus:prices:recompute

## Recompute for a single product (all websites)
bin/magento omnibus:prices:recompute --product-id=42

## Recompute for a single product on a specific website
bin/magento omnibus:prices:recompute --product-id=42 --website-id=2

## Delete history older than the configured retention period, or a given date.
## The newest pre-cutoff record per product/website/group is always preserved.
bin/magento omnibus:history:clean
bin/magento omnibus:history:clean --before=2025-01-01
bin/magento omnibus:history:clean --before="2025-01-01 12:00:00"

_(README truncated for .md surface. Full README on https://packagento.com/magendoo/module-omnibus.)_

## Recent Versions

| Version | Released |
|---|---|
| 2.0.1 | 2026-07-20 |
| 2.0.0 | 2026-07-18 |
| 1.0.0 | 2026-04-16 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | >=103.0.0 |
| magento/module-backend | >=102.0.0 |
| magento/module-catalog | >=104.0.0 |
| magento/module-catalog-rule | >=101.2.0 |
| magento/module-eav | >=102.1.0 |
| magento/module-sales-rule | >=101.2.0 |
| magento/module-store | >=101.0.0 |
| magento/module-tax | >=100.4.0 |
| magento/module-ui | >=101.2.0 |
| php | >=8.1 |

### Require (dev)

| Package | Constraint |
|---|---|
| phpstan/phpstan | ^1.10 \|\| ^2.0 |
| phpunit/phpunit | ^10.5 |

## Quality

Latest release (2.0.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 181 | 181 warnings (ruleset: Magento2), 22 auto-fixable with phpcbf |
| PHPMD | Warning | 142 | 142 rule violations (UnusedPrivateField:142) |
| Cpd | Warning | 2 | 2 duplicated chunks spanning 27 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 10 | valid; 10 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 32 | 32 | – | – |
| 2.4.8 | – | 32 | 32 | – |
| 2.4.9 | – | – | 32 | 32 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["magendoo/module-omnibus"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

magendoo is a Magento 2 vendor on Packagento. See https://packagento.com/magendoo.md for their full catalogue.

