Value column in conditions table ignores value_callback
haffmans - October 21, 2008 - 19:40
| Project: | UC Discounts |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Description
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.
| Attachment | Size |
|---|---|
| uc_discounts_value_format.patch | 517 bytes |

#1
Cleaned up patch a bit according to Drupal guidelines. Code is still the same.
#2
Hi tszcheetah, Thanks a lot for the patch, but could you please give an example of what this patch fixes? The more details, the better.
#3
Go 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).
#4
Patch 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