Hi,
I am not still sure how to modify currency sign for different languages. Is there anything like hook for uc_currency_format?
In the meanwhile, I would like to use variables uc_currency_code, uc_currency_sign... as multilangual variables. I wrote a small piece code. I was wondering whether it would possible to implement it into uc_store.
file uc_store.module
/**
* Implements hook_init().
*/
function uc_store_init() {
.....
$conf['i18n_variables'][] = 'uc_currency_code';
$conf['i18n_variables'][] = 'uc_currency_sign';
$conf['i18n_variables'][] = 'uc_currency_thou';
$conf['i18n_variables'][] = 'uc_currency_dec';
$conf['i18n_variables'][] = 'uc_currency_prec';
$conf['i18n_variables'][] = 'uc_sign_after_amount';
}
I wrote some code which connects mentioned variables with module Variable.
Comments
Comment #1
tr commentedThose should not be multilingual variables. Language has little or no correspondence to currency. For example, what currency should be associated with English? USD, CAD, GBP, EUR ? All of those, and more, are in use in English-speaking countries.
Comment #2
MPeli commentedOk, I understand.
The best way would be to create a custom module. I still can not figure out how to change currency in a custom module. Is there anything like hook for uc_currency_format? Or what approach should I use?
Thanks, Martin.
Comment #3
MPeli commentedI might get it. I assume that with this approach I can alter sign and price of all products.
Requires Variable module. I hope it helps.
Comment #4
longwaveAs noted this isn't the right approach for true multicurrency, but this might work for some cases as an stopgap solution.
Comment #5
MPeli commentedHi,
I have put together a small multicurrency module. It allows you to assign a currency for each language. I hope it will inspire somebody to create a real multicurrency module.
Martin.
Comment #7
BenLalleke commentedHello Martin,
I'm trying to implement your solution as a workaround for the missing multicurrency problem in drupal 7. I installed en enabled the module (also the variable and variable_realm modules) and changed the settings.. I have two languages in my website, for test purposes I assigned dollar (USD with the $ sign) to my language "dutch" (nl) en left my default language (English) with the currency EUR. However, when I open my website in dutch (which is triggered by surfing to my website /nl) my prices are still in euro and not in dollar. I don't understand where the problem might be, you have any ideas? Thanks!
Comment #8
tr commented@BenLalleke: The Ubercart issue queue is not the place to hold discussions on the development of modules other than core Ubercart. You can pursue this question on ubercart.org, by private communications, or by creating a sandbox project on drupal.org to use for your work.