Same issue as https://www.drupal.org/project/commerce/issues/3392225 🐛 Promotion applies() doesn't exclude $this when checking other promotions, if set as COMPATIBLE_NONE Fixed and fixed there.
The reason for that is that the order is validated before being saved/refresh, therefore the logic in "Promotion::applies()" considers that the promotion doesn't apply because there's already a promotion applied.
I think we should add an additional check in that logic (check that the adjustment source ID doesn't match the promotion being evaluated, though I'm wondering if that wouldn't technically allow reapplying the same promotion.
We should probably change the following:
foreach ($order->collectAdjustments() as $adjustment) {
if ($adjustment->getType() == 'promotion') {
return FALSE;
}
}
to
foreach ($order->collectAdjustments() as $adjustment) {
if ($adjustment->getType() == 'promotion' && $adjustment->getSourceId() !== $this->id()) {
return FALSE;
}
}
Closed: duplicate
2.0
Promotions
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Same issue as https://www.drupal.org/project/commerce/issues/3392225 🐛 Promotion applies() doesn't exclude $this when checking other promotions, if set as COMPATIBLE_NONE Fixed and fixed there.