Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
Is it possible to change the coupon's line item label, so instead of reading "Percentage coupon" it would read "COUPON-CODE coupon" (where "COUPON-CODE is replaced by the actual code)? I know it's a tiny issue, but I think it would make for a more pleasant user experience.
Many thanks!
Comment | File | Size | Author |
---|---|---|---|
#8 | price-component-display-title-1598036.patch | 769 bytes | mglaman |
#8 | Screen Shot 2013-06-13 at 11.15.15 AM.png | 12.38 KB | mglaman |
#8 | Screen Shot 2013-06-13 at 12.25.22 PM.png | 11.57 KB | mglaman |
#7 | Screen Shot 2013-06-13 at 11.15.15 AM.png | 12.38 KB | mglaman |
Comments
Comment #1
pcambraWeird, the label of the line item should be type + coupon code, not just the type.
I think all these issues would be solved by adding a label to coupon entities.
Comment #2
jonathan_hunt CreditAttribution: jonathan_hunt commentedI see code in commerce_coupon_line_item_new() that defines a line item label as
but it doesn't look like this label is used anywhere. All instances of Percentage coupon in cart and order simply appear as "Percentage coupon".
Comment #3
arbel CreditAttribution: arbel commentedI don't see why type is important, I agree a label is a great option, but the user wouldn't normally care what technical type of coupon it is, as long as he gets the discount he expects.
Idan
Comment #4
ericaack CreditAttribution: ericaack commentedActually, I think it's very important to show the coupon name in the admin order view. We need to be able to track which coupon was applied to which order. Some coupons, for example, are paid for out of one scholarship fund, some out of another. I would think that commercial sites would also want to be able to view this information easily.
Thanks for your work on this.
Comment #5
arbel CreditAttribution: arbel commentedI agree that the copuon code or a label you use to identify the coupon should be displayed, but the type is just based on how the module is built and has nothing to do with the coupon. i
Comment #6
pcambraHere's how the coupon line item title is generated:
http://drupalcode.org/project/commerce_coupon.git/blob/refs/heads/7.x-1....
Any improvements in that area are welcome
Comment #7
mglamanComment #8
mglamanScratch my previous statement, discover function was commerce_coupon_commerce_price_component_type_info(). Here is my patch, uses entity_metadata_wrapper() to get coupon code and use as display title.
Attached is my patch and before/after screenshots.
Comment #9
FiNeX CreditAttribution: FiNeX commentedThe patch works fine. Thanks.
Comment #10
loze CreditAttribution: loze commentedyou can do this without a patch using hook_commerce_price_component_type_info_alter() in a custom module