Drupal is a registered trademark of Dries Buytaert
drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)!

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

Activity

Total releases
1
First release
Mar 2026
Latest release
2 months ago
Release cadence
Stability
100% stable

Releases

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