CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Price set option label uses site global currency symbol not defaultCurrency
Pages: [1]

Author Topic: Price set option label uses site global currency symbol not defaultCurrency  (Read 738 times)

Piyush

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
    • Pecan Solutions
Price set option label uses site global currency symbol not defaultCurrency
March 02, 2010, 09:24:44 am
Hi,

I used the info at http://civicrm.org/node/547 and the buildForm hook to change the currency for an event to USD (the site global settings default is UK GBP). I have done this method succesfully before for CiviContribute forms but not used it for events.

This event also has a price set and what's happening is that if you opt to display the value of the price set option, the price set option label uses the site global currency symbol ('£' on this site) instead of the symbol for the $config->defaultCurrency (which for this event should be '$').

I've tried to figure out where these labels are being set (in code and/or template files) and unfortunately am stuck trying to decipher this.

Would appreciate any help that you can offer.

Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Price set option label uses site global currency symbol not defaultCurrency
March 02, 2010, 11:08:01 am

the labels are created BEFORE the buildForm hook is called. The code is here:

CRM/Price/BAO/Field.php (in v3.1)

search for currency

not sure of how to get around this. I suspect in 3.1 and later, you should set the currency in the config hook

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmconfig

lobo

« Last Edit: March 02, 2010, 11:10:14 am by Donald Lobo »
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Price set option label uses site global currency symbol not defaultCurrency

This forum was archived on 2017-11-26.