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.
In the conditions table of a discount, the "value" does not use the value_format_callback function if it is available. Attached patch fixes this.
Comment | File | Size | Author |
---|---|---|---|
#1 | uc_discounts_value_format.patch | 532 bytes | haffmans |
uc_discounts_value_format.patch | 517 bytes | haffmans |
Comments
Comment #1
haffmans CreditAttribution: haffmans commentedCleaned up patch a bit according to Drupal guidelines. Code is still the same.
Comment #2
psynaptic CreditAttribution: psynaptic commentedHi tszcheetah, Thanks a lot for the patch, but could you please give an example of what this patch fixes? The more details, the better.
Comment #3
haffmans CreditAttribution: haffmans commentedGo to admin/store/discounts/ and click one of the discounts. The "value" column in the conditions table contains unformatted values. For example, if you use the "Order total" condition, and you enter a dollar value (let's say 20), just the number is displayed in the conditions table. You would normally expect the dollar value (e.g. "$20") to be displayed. This patch fixed this - it only changes the output to that table.
I've also got a self-made discount module that stores IDs in the value, but I want it to display actual (user-friendly) names in the table instead.
If I'm not mistaken then the original uc_discounts module also formatted the value this way, but it got removed along the way (before the module got on drupal.org).
Comment #4
joachim CreditAttribution: joachim commentedPatch is fine, but the only place where it has an effect, uc_discounts_order_total_value_format, is using a hardcoded $. Localization FAIL!
So this needs to be fixed first: http://drupal.org/node/326403