Promotion applies() doesn't exclude $this when checking other promotions, if set as COMPATIBLE_NONE

Created on 6 October 2023, about 1 year ago
Updated 29 November 2023, 12 months ago

Steps to reproduce:

  • create a promotion, set it as not compatible with any other promotions, and create a coupon for it
  • create a draft order, apply the coupon, save
  • reopen the order edit page and attempt to save

Result: saving fails with error message on the coupon field: "The provided coupon code code is invalid".

Proposed resolution:

Method \Drupal\commerce_promotion\Entity\Promotion::applies() needs to exclude $this promotion when checking against the already saved promotions from the $order.

🐛 Bug report
Status

Fixed

Version

2.36

Component

Promotions

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024