Jump to content

Link currency to language


Recommended Posts

In "classes/Tools.php" locate this code below:

public static function switchLanguage()
{
	global $cookie;

	if ($id_lang = (int)(self::getValue('id_lang')) AND Validate::isUnsignedId($id_lang))
		$cookie->id_lang = $id_lang;
}

Remplase for this below:

public static function switchLanguage()
{
	global $cookie;
	if ($id_lang = (int)(self::getValue('id_lang')) AND Validate::isUnsignedId($id_lang))
 {
		$cookie->id_lang = $id_lang;

		switch($id_lang)
  {
			case 1: //if lang_id that's changed to is = 1 than...
				$cookie->id_currency = 1;  //change the currency too, the currency that has the id 2
				self::setCurrency();
				break;
		}		}
}

The problem with this is that after not giving you the ability to change the currency as long as you choose English

If you need to create more conditions, only adds more:

			case 1: //if lang_id that's changed to is = 1 than...
				$cookie->id_currency = 1;  //change the currency too, the currency that has the id 2
				self::setCurrency();
				break;

Only change "case 1:" to id language you need and "$cookie->id_currency = 1;" to currency for that case.

Remenber activate Forze compile.

Link to comment
Share on other sites

  • 10 months later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...