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!

Comments

Weird, 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.

I see code in commerce_coupon_line_item_new() that defines a line item label as

$line_item->line_item_label = $coupon_wrapper->type->label() . ': ' . $coupon_wrapper->commerce_coupon_code->value();

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".

I 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

Actually, 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.

I 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

Here'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

StatusFileSize
new12.38 KB

Scratch 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.

The patch works fine. Thanks.