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
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:
- 3176622-coupon-errors
changes, plain diff MR !10
Comments
Comment #3
ayalon commentedThe 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.
Comment #4
ayalon commentedComment #5
rszrama commentedCouldn't get the rebase to work so grabbed the diff and committed. : P