Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Commerce
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
17 Jun 2011 at 10:21 UTC
Updated:
7 Oct 2013 at 14:26 UTC
Hi,
Really enjoying setting up Commerce software.
I changed default store currency to AUD and put checked the AUD as the only enabled currency.
Unfortunately there are no other setting shown, like how I would like the currency displayed.
In Australia we display the price of things in exactly the same manner as they do in the USA
A price in Australia looks like:
$49.50
and never looks like anything else, always starts with a dollar sign before the price and nothing more.
How can this be achieved in Commerce?
Thankyou, really need help with this.
Regards from Josh
Comments
Comment #1
rszrama commentedWe should just have to update the currency array with the proper values. See http://www.drupalcommerce.org/faq/currency-format for more info.
Comment #2
jlhs commentedGreat, thanks Ryan,
Excellent job you are doing with commerce!
All the best from Josh
Comment #3
rszrama commentedOut of curiosity, what do you do in multi-currency scenarios?
Comment #4
jlhs commentedHello Ryan,
I am building a site for an Australian watch shop. The shop is only going to be for an Australia wide market.
If the site was multi-currency and aiming for a global market, I guess I would give the USA the nicer looking single $ sign because it has more people and a bigger market and Australia I would still put the $ sign before the price (After just looks ugly). But I would have the price for Australian dollars as Au$
I have updated the array to just a dollar sign as suggested and the other key > value I grabbed from the American dollar amount array to put the price before. Thankyou.
All the best from Josh
I hope I can get my PHP chops up to scratch someday soon so I can add to this project some time. Great work!
Comment #5
mikejoconnor commentedI'm going to go ahead and mark this fixed. Please re-open if you need more assistance.
Comment #6
essbee commentedHi Josh,
I had the same issue so I just built a module that changes to the expected way of displaying. Entire module code is 1 function with 3 lines of code.
If you just create the following two fles and put in a folder called commerce_aud then enable your module you will be all good. Then when it gets fixed in the module later you can just disable and remove the module.
Cheers,
Sam
Filename: commerce_aud.module
Filename: commerce_aud.info
Comment #7
jlhs commentedNice one Sam. Thanks.
That should stop having to edit files each Drupal Commerce upgrade.
All the best from Josh
Comment #8
rszrama commentedI'd definitely support a module that lets sites do custom currency formatting. I think there's an open issue for it... just a matter of getting tweaks like this one into a settings form somewhere. : D
Comment #9
essbee commentedYeah, are you thinking something like a form with just "currency prefix" and "currency suffix" fields. That would be about the grand total of it wouldnt it?
I guess to take it further and make it multi-currency supportive you would have it read the active currencies and offer up prefix/suffix fields for each.
Comment #11
husumiao-1 commentedThank for essbee.
I take 2 hours for it last day, and never resolved it. Because i think there is should be options settings can do that, actually i never found it. Thanks again.
Comment #12
silvio pontes commentedThank you essbee.
I create the folder called commerce_aud.
I create the two files called commerce_aud.module and commerce_aud.info.
I try to install this module, but is show to me error message.
To create the two files i use the N++.
Do you have tip?
Best Regards,
silvio pontes
Comment #13
rszrama commented(This is a pretty old issue, so it's best to leave it closed and either use essbee's contact form if it's enabled or seek help in the #drupal-commerce IRC channel.)
Comment #14
Heather51 commentedJust for anyone whose using the code in #6 I was getting errors because I hadnt noticed that the line:
function commerce_cellier_commerce_currency_info_alter(&$currencies, $langcode)
should read :
function commerce_aud_commerce_currency_info_alter(&$currencies, $langcode)
also changed the line:
$currencies['AUD']['code_placement'] = '';
to:
$currencies['AUD']['code_placement'] = 'hidden';
The code which work for me in a module named commerce_aud as per instructions in #6 is a follows:
function commerce_aud_commerce_currency_info_alter(&$currencies, $langcode) {
$currencies['AUD']['symbol'] = '$';
$currencies['AUD']['symbol_placement'] = 'before';
$currencies['AUD']['code_placement'] = 'hidden' ;
}
Everything now perfect. Thanks for a simple fix. Would be great if these settings could be incorporated into the commerce admin ui.
Comment #15
shaneonabike commentedWow..
I think that it would be great to have this as an option in Drupal Commerce to add the appropriate symbol? This is pretty standard regardless of adding the CAD/AUD/USD afterwards
Thoughts...
Comment #16
mbahlol commentedthanks essbee and heather51. this is what i do for my Indonesian Rp
Comment #17
relaxpor commentedDon't forget to clear the cache, everything work
Comment #18
matthijs_hofstede commentedFor future referece, i was looking for a way to move the symbol. I found this module that does the trick:
https://drupal.org/project/commerce_currency_settings