Problem/Motivation

There are three reasons a coupon code might be rejected, doesn't exist, not available, can't be applied to order. Currently all of these tell the customer "The provided coupon code is invalid." It would be better to provide more helpful information to the user.

Proposed resolution

Stage 1: Provide better error messages for the user

Not Available: The provided coupon code is not available, it may have expired or have already been used.
Not Applies: The provided coupon code cannot be applied to your order.

Stage 2: Configurable error messages

This will need further work and thought; should the error message be configured by promotion, store or sitewide?
Should the errors be more fine-grained i.e. "The coupon has reached is usage limit" and "The coupon has expired"

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork commerce-3176622

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dwkitchen created an issue. See original summary.

ayalon’s picture

The MR solves "Stage 1" and can be safely merged because it is an overall improvement for the user trying to apply an invalid coupon code.

ayalon’s picture

Status: Active » Reviewed & tested by the community
rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Couldn't get the rebase to work so grabbed the diff and committed. : P

  • rszrama committed 4c82a45 on 8.x-2.x authored by dwkitchen
    Issue #3176622 by dwkitchen, ayalon: Make the invalid coupon code...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.