Change sequence of currencies in dropdown selectio

  • Jono
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 9 months ago #100516 by Jono
When enabling multiple currencies, is there a way to re-order these currencies in the drop down list for the frontend donors?

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #100652 by Mr. Dam
Hi Enoch,
You can change the order of currencies by modifying file: root > components > com_jdonation > helpers > currencies.php
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Jono
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 8 months ago #101949 by Jono
Hi Dam,
Thank you for your help - I don't think that is the right file to edit.
I checked it and it has a long alphabetical list of currencies.
However, the dropdown list in the frontend of the web site when a user wants to make a donation has far fewer currencies, and is sorted quite differently - starting with Canadian Dollars and then Euros at the top.
How do I change the sequence of the currencies in this frontend dropdown?

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #101961 by Mr. Dam
Hi,
Here are solution.
1. Open file: root > components > com_jdonation > view > donation > html.php
2. Find:
Code:
$query->clear(); $query->select('currency_code, currency_name') ->from('#__jd_currencies'); if ($config->active_currencies) { $activeCurrencies = explode(',', $config->active_currencies) ; $query->where('currency_code IN ("'.implode('","', $activeCurrencies).'")'); }

and add this line below:
Code:
$query->order('currency_code');

By this way, the currencies will be ordered by Currency Code (Alphabetic)

Thanks
Dam

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamDũng Nguyễn Việt