I did what Nicolas suggested but put it directly in index.php
// Set the currency at the first visit, regarding of the page language
function set_currency($app)
{
$used_languages = [
[ "tag" => "en-us", "currency" => 2 ],
[ "tag" => "ja-JP", "currency" => 3 ],
[ "tag" => "en-GB", "currency" => 4 ],
[ "tag" => "en-AU", "currency" => 6 ],
[ "tag" => "zh-TW", "currency" => 111 ],
[ "tag" => "ko-KR", "currency" => 145 ] ];
$lang = JFactory::getLanguage();
if(!$app->getUserState('com_hikashop.currency_id',0))
{
foreach($used_languages as $language)
{
if ($language["tag"] == $lang->get('tag'))
{
$app->setUserState('com_hikashop.currency_id', $language["currency"]);
header('Location: '.$_SERVER['REQUEST_URI']);
exit(0);
}
}
}
}
and called the function here :
// Dispatch the application.
$app->dispatch();
set_currency($app);
// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
I think this is the good way to do, you help the user the first time and after you let him free to choose which couple language/currency he wants.