- Issue created by @loze
- 🇮🇱Israel jsacksick
Are you using dev? Did you set the promotion compability to "none"? (i.e. "Not with any other promotions").
If you're running dev, 🐛 Promotion applies() doesn't exclude $this when checking other promotions, if set as COMPATIBLE_NONE Fixed might have caused a regression... But perhaps we should enforce this somehow.
- Status changed to Needs review
over 1 year ago 8:50am 29 November 2023 - last update
over 1 year ago 776 pass, 6 fail - 🇺🇸United States loze Los Angeles
I am using dev. I dont want to set the compatibility to none, because I still want other promotions to apply.
This patch appears to resolve my issue.
Thanks.
- last update
over 1 year ago 786 pass, 2 fail - 🇮🇱Israel jsacksick
The attached patch should address the test failures. For some reason our tests apply 2 coupons belonging to the same promotion (which I believe is a mistake).
- last update
over 1 year ago 788 pass -
jsacksick →
committed 4a8e0730 on 8.x-2.x
Issue #3404821 by jsacksick, loze: Limit promotion to only apply once...
-
jsacksick →
committed 4a8e0730 on 8.x-2.x
-
jsacksick →
committed fb1d99a8 on 3.0.x
Issue #3404821 by jsacksick, loze: Limit promotion to only apply once...
-
jsacksick →
committed fb1d99a8 on 3.0.x
- Status changed to Fixed
over 1 year ago 1:09pm 30 November 2023 - Status changed to Needs review
over 1 year ago 3:37pm 30 November 2023 - last update
over 1 year ago 788 pass - 🇬🇧United Kingdom alexpott 🇪🇺🌍
This added an unused use to a class which makes MR testing fail. Here's a quick fix.
-
jsacksick →
committed b467a953 on 8.x-2.x
Issue #3404821 followup by alexpott: Fix a phpcs violation introduced.
-
jsacksick →
committed b467a953 on 8.x-2.x
-
jsacksick →
committed 39c47746 on 3.0.x
Issue #3404821 followup by alexpott: Fix a phpcs violation introduced.
-
jsacksick →
committed 39c47746 on 3.0.x
- Status changed to Fixed
over 1 year ago 4:30pm 30 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 12:45pm 12 January 2024 - 🇦🇺Australia elc
The inclusion of this block of code has broken our workflow:
https://git.drupalcode.org/project/commerce/-/commit/4a8e073085981f3a0d6...
// The promotion might already be applied, make sure we don't apply the // same promotion more than once. if ($referenced_coupon->getPromotionId() == $coupon->getPromotionId()) { $form_state->setErrorByName($coupon_code_path, $this->t('The provided coupon code cannot be applied to your order.')); return; }
The introduction of this block of code has broken functionality - I do want users to be able to apply multiple single use unique coupon codes to an order. In our case, each one gives up to $20 off the order. If a user uses 2 of them, they get $40 off etc. Trying to use the same coupon twice still rejects which is desired.
I can just remove this code for now, but it would be ideal if this was configurable in the usage limits: total allowed uses per order. I thought it was working just fine as it was.
- 🇮🇱Israel jsacksick
@ELC: To me what was fixed here makes sense... Not really sure what is the usecase for allowing the same promotion to be applied indefinitely.
- 🇦🇺Australia elc
Added it as described in 🐛 Regression: Limit promotion (via coupon) to only apply once per order Active . Adding more detail now to clarify the use case.