Posted by Carlitus on November 6, 2009 at 12:04pm
Jump to:
| Project: | Ubercart |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
I'm attaching a patch to include and option to remove the decimals from the price when it is shown if they are zero.
El saludo!
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| uc_price_remove_decimals.patch | 922 bytes | Ignored: Check issue status. | None | None |
| uc_store_admin_remove_decimals.patch | 681 bytes | Ignored: Check issue status. | None | None |
Comments
#1
I think this is a theming issue and does not belong in Ubercart core. You can format the price how you want using the standard Drupal theming mechanism of overriding theme_uc_product_price(), or you can hook into the Ubercart price formatter.
#2
I know, i've made this before with the hooks but i think this can be useful to lot of people, we use it every time.
What is the difference between this and the currency sign in the left or in the right?
#3
Marking as won't fix because this can and should be done in the theme.
#4
Hi,
Sorry to open this issue. I don't want to hack core as well. Can anybody help me with theming prices?
I only want to remove the decimals when they are 00. For example 5,00 € should be 5 €, but 5,50 € should remain the same, not 5,5 €.
Thank you very much.
#5
I answered that in #1. If you need help using core Drupal theming, I suggest trying the Drupal IRC channels, reading the theming documentation on drupal.org, or reading a book on Drupal.