Question regarding changing global currency default
Posted: 26 Dec 2022, 12:03
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
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