Hi Jan
This is just a question. On my site, default currency is Euro as most customers come from Europe. Second currency is Swiss Franc CHF.
Many Swiss customers don't realize that it is actually a Swiss site and don't change the currency to CHF. As prices are the same in EUR and CHF, with the current rate of exchange that hurts a little
I am now trying to fix the default currency of Phoca Cart for visitors from Switzerland to CHF and leave the rest of the world in EUR.
I don't want to use geolocation libraries. For me it is sufficient to check if a user comes from a .ch domain using php gethostbyaddr.
This is trivial to implement in the mod_phocacart_currency but this is obviously not enought. For phoca_cart and checkout the default is still EUR if I don't explicitly set the currency using the currency dropdown.
Now my question: where can I best put the gethostbyaddr code checking for .ch domain to change the global phoca currency default?
Sorry to bother you with such a customizing question. It would be very kind if you could just point me in the right direction.
Thank you very much!
Alexander
Question regarding changing global currency default
-
- Phoca Enthusiast
- Posts: 79
- Joined: 15 Jan 2020, 17:36
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Question regarding changing global currency default
Hi, try to see:
viewtopic.php?t=61402
So adding some detection of .ch domain before this line:
$id = 2;// my own currency
and then setting the $id to this currency should work
Jan
viewtopic.php?t=61402
So adding some detection of .ch domain before this line:
$id = 2;// my own currency
and then setting the $id to this currency should work
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 79
- Joined: 15 Jan 2020, 17:36
Re: Question regarding changing global currency default
Hi Jan
Absolutely GREAT! support for an extremely versatile and - amazingly - fee product.
Thank you very much!
Alexander
Absolutely GREAT! support for an extremely versatile and - amazingly - fee product.
Thank you very much!
Alexander
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Question regarding changing global currency default
Ok, great to hear it.
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 79
- Joined: 15 Jan 2020, 17:36
Re: Question regarding changing global currency default
Hi Jan
just implemented viewtopic.php?t=61402 on my test site. Works perfectly! I added the code to the Phoca controller.php not the template as I think changes to Phoca should be made in Phoca code.
Thank you very much.
This ticket can be sucessfully closed
Alexander
just implemented viewtopic.php?t=61402 on my test site. Works perfectly! I added the code to the Phoca controller.php not the template as I think changes to Phoca should be made in Phoca code.
Thank you very much.
This ticket can be sucessfully closed
Alexander
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Question regarding changing global currency default
Ok, thank you for the info.
Jan
Jan
If you find Phoca extensions useful, please support the project
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Question regarding changing global currency default
It can now be done with a plugin: https://github.com/PhocaCz/PhocaCartCur ... v4.0.0.zip
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 79
- Joined: 15 Jan 2020, 17:36
Re: Question regarding changing global currency default
Hi Jan
Thank you!!! Nice that you remembered my question. I will test the plugin as soon as possible.
Kind regards
Alexander
Thank you!!! Nice that you remembered my question. I will test the plugin as soon as possible.
Kind regards
Alexander
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Question regarding changing global currency default
Ok
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 79
- Joined: 15 Jan 2020, 17:36
Re: Question regarding changing global currency default
Hi Jan
I would like to have Swiss CHF for visitors coming from .ch domains and EURO for the rest. So I cover at least 80% of Swiss cusomers and a lot of others.
The Plugin seems to use the installed Joomla languages. Unfortunately, I live in Switzerland. We have 4 different languages (DE, FR, IT and Romantsch), all use CHF. Worse, in Germany and Austria they speak also German and in France (among others) and Italy French and Italian but they use EURO or other currencies. As far as I know there is CH-DE and CH-FR language packs but no CH-IT or CH-"ROM". So its very complicated To use the plugin I would have to install at least 6 additional language packs and I would miss the Italien and Romantsch speaking parts of Switzerland. And I would have to tell Joomla to consider the browser language and not the installed language. My browser language e.g. is English. Terribly complicated for such a strange multilaguage county like Switzerland
An as far as I know there are a lot of different countries that speak e.g. English or French or Spanish or Portugese that have different currencies. Similar problem.
Its a nice plugin that works for a lot of countries but I think I stick to checking the visitors domain extension (.ch) to decide if I present CHF or EURO.
Or I have missed or misunderstood something essential about the plugin.
Thank you very much and kind regards
Alexander
I would like to have Swiss CHF for visitors coming from .ch domains and EURO for the rest. So I cover at least 80% of Swiss cusomers and a lot of others.
The Plugin seems to use the installed Joomla languages. Unfortunately, I live in Switzerland. We have 4 different languages (DE, FR, IT and Romantsch), all use CHF. Worse, in Germany and Austria they speak also German and in France (among others) and Italy French and Italian but they use EURO or other currencies. As far as I know there is CH-DE and CH-FR language packs but no CH-IT or CH-"ROM". So its very complicated To use the plugin I would have to install at least 6 additional language packs and I would miss the Italien and Romantsch speaking parts of Switzerland. And I would have to tell Joomla to consider the browser language and not the installed language. My browser language e.g. is English. Terribly complicated for such a strange multilaguage county like Switzerland
An as far as I know there are a lot of different countries that speak e.g. English or French or Spanish or Portugese that have different currencies. Similar problem.
Its a nice plugin that works for a lot of countries but I think I stick to checking the visitors domain extension (.ch) to decide if I present CHF or EURO.
Or I have missed or misunderstood something essential about the plugin.
Thank you very much and kind regards
Alexander