Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Screenshot: Example with limited Coupon:
Note: The coupon code exists and is correct.
The problem
The used messages are not the best.
1. Second message in limited coupon context
- The message are wrong if entered coupon code exist and correct.
- In the displayed special case, limited coupon, the second message are not needed.
Give the user a hint! A better message in this context, for example:
Please remove the code, or use a different code.
2. Second message in correct coupon context without limitation
The message
Your coupon code is not valid.
is too little information.
Give the user a hint! A better message, for example: See example above.
3. Second message in wrong coupon context without limitation
Use the exist second message and extend the message with a hint. For the hint see first example above.
Comment | File | Size | Author |
---|
Comments
Comment #1
pcambraPatches are welcome.
Comment #2
quiptime CreditAttribution: quiptime commentedSorry, patches for this module currently not possible by me.
Right now, my work is focused on the Commerce Payment Network module.
Comment #3
pcambraI must say that this is how feature request normally work :)
Comment #4
bkonetzny CreditAttribution: bkonetzny commentedJust thinking: maybe it would be better to clear the coupon form and add the used/failed coupon code to the message? What do you think about that? In this case, the failed code doesn't have to be removed by the user, and we still supply the given code in the error-message.
Comment #5
quiptime CreditAttribution: quiptime commentedgood idea
good idea
Comment #6
Juisi CreditAttribution: Juisi commentedHello!
i'd start by adding
-date invalidation specific message, something like "Coupon is valid from date - date"
-maximum usage invalidation.
The date validation is built into the "calculate the sell price of the product" discount rule having a date checker condition in it.
Being no rules expert, hacking this code seems not like the best idea.
The coupon module acts as a controller for the coupon validation and to me it seems a plausible idea to write a piece of rules independent code that checks the dates, puts out the message and modifies the $error variable that is passed as a reference to the commerce_coupon_evaluate_conditions -function.
-Jussi