"The provided coupon code is not available. It may have expired or already been used." needs to show details

Created on 21 November 2024, about 1 month ago

Problem/Motivation

Entering a coupon code in the checkout may lead to

The provided coupon code is not available. It may have expired or already been used.

errors.

Not only for the customers, but also for shop owners it is a problem that no details are shown at all about the reason (if the coupon code is empty).

We've had several cases where clients reported that coupon codes do not work, while they should.
(In most cases this was caused by this limitation on the email address, that has not been entered yet, as it's in the same step:

if ($usage_limit_customer) {
      // Promotion cannot apply to orders without email addresses.
      if (!$email = $order->getEmail()) {
        return FALSE;
      }
      if ($usage_limit_customer <= $usage->load($this, $email)) {
        return FALSE;
      }
    }

I think for this one we'll need a separate issue that the coupon code pane may not be in the same step as the guest checkout email input - or better solve it differently.
)

Still it would be super helpful to return details from the available() methods in class Promotion and class Coupon

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

3.0

Component

Promotions

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇮🇱Israel jsacksick

    Yeah, I got this complaint too, but this is a big change request... For this to work, we'd need conditions to return a reason, and not just a boolean... So we'd probably need to introduce a value object similar to the AvailabilityResult...

    Something like ConditionResult or ConditionEvaluationResult. Because fixing this from available isn't sufficient... If the coupon cannot be applied due to an order total condition, you'd like to know that either... But this would require a ton of changes.

  • 🇩🇪Germany Anybody Porta Westfalica

    Yeah totally understand. It's a typical software design issue with side-effects ;D

Production build 0.71.5 2024