Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Entity Usage 5.0.0 Major update available for module entity_usage (5.0.0). Release: Entity Usage 8.x-2.3 Minor update available for module entity_usage (8.x-2.3). Release: Excel Serialization 2.2.0 Minor update available for module xls_serialization (2.2.0). Release: TMGMT DeepL Integration 2.4.2 Minor update available for module tmgmt_deepl (2.4.2). Release: Disable Login Page 1.2.0 Minor update available for module disable_login (1.2.0). Release: Akamai 5.1.1 Minor update available for module akamai (5.1.1). Release: GraphQL 5.1.0 Minor update available for module graphql (5.1.0). Release: Charts Plotly 1.0.5 Minor update available for module charts_plotly (1.0.5). Module Revived: Two-factor Authentication (TFA) 8.x-1.13 Module tfa updated after 10 months of inactivity (8.x-1.13). Usage Milestone: Easy Email Module easy_email crossed 10,000 active installs.

Affected by promotion

27 sites Security covered Drupal 8–11
View on drupal.org

This module provides a service to retrieve entities associated with a promotion. It allows developers to query for specific types of entities that a promotion applies to. This functionality can be integrated into offer type plugins by implementing a specific interface.

Provides a service to give you the entities that are affected by a promotion.

If your offer type supports it, you can do stuff like this:

/** @var \Drupal\affected_by_promotion\AffectedEntitiesManager $mng */
$mng = \Drupal::service('affected_by_promotion.affected_entities_manager');
/** @var \Drupal\Core\Database\Query\SelectInterface $q */
$q = $mng->getAffectedEntitiesQuery($promotion, 'commerce_product');
$products = $q->execute();

For your offer type plugin to support it, it has to implement the following interface:

\Drupal\affected_by_promotion\SupportsAffectedEntitiesQueryInterface

Which has the following method:

public function getAffectedEntitiesQuery($entity_type_id);

There is also an issue to get this into commerce: https://www.drupal.org/project/commerce/issues/3007070

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Mar 2026
Latest release
5 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
8.x-1.5 Stable 8–11 Mar 19, 2026