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.
The coupon value column in the checkout pane is not user friendly. It has a label and then a decimal representation of a percentage. Much better for it just to say "10% off" - and at least if we're talking to end users, we should always convert those decimals to percentage strings. Otherwise it can look like 10 cents off even if the label says "Percentage."
I'd just get rid of the label altogether and make it the concise "10% off" or perhaps "10% off the order" if you need to differentiate it against a percentage off a specific product.
Comment | File | Size | Author |
---|---|---|---|
coupon-value-fix-1.png | 115.74 KB | rszrama |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedComment #2
pcambraShall we add some label callback calculation in the coupon entity? maybe something like "[Type] coupon added: [discount label]" that would be "Order coupon added: 10% off"
Comment #3
rszrama CreditAttribution: rszrama commentedI'm not sure I have a strong recommendation. You could always make it a configurable part of the coupon entity or even just use the same string you use for the price component type. fwiw, Dan has implemented a temporary solution for use on a current site, but I think this is still an open issue.
Comment #4
dpolant CreditAttribution: dpolant commentedTake a look at commerce_coupon_commerce_coupon_discount_value_display_alter - this is how the labels get set and can be overridden. I just committed a fix that cleans up this display. Originally it was using field_view_field which was why the "percentage" label kept showing up. Now it just formats a string which seems better because there is no UI for people to customize Discount offer fields anyway.
I like the idea of using callbacks instead of an alter hook for this though. I may try that approach. Still would like some feedback on the value description updates though.
http://drupalcode.org/project/commerce_coupon.git/commit/0ec43f5