Martin89 Posted February 14, 2011 Share Posted February 14, 2011 Ik heb zelf een aanpassing gedaan in het systeem, nu wil ik de variabele van de taal kunnen ophalen.Onderstaande werkt niet, dit had ik wel verwacht. Moet ik hiervoor nog iets erbij gebruiken of zit ik helemaal verkeerd?'.intval($cookie->id_lang).' Hoop dat jullie begrijpen wat ik bedoel.Ik wil dit gebruiken voor een stukje if else... Link to comment Share on other sites More sharing options...
barthuttinga Posted February 18, 2011 Share Posted February 18, 2011 Hoi Martin89,Wat je zegt klopt wel - zeg ik uit mijn hoofd - maar je moet wel beschikken over de globale variabele $cookie. Dat doe je door "global $cookie;" (zonder de aanhalingstekens) in de functie op te nemen. Succes!Groet,Bart Huttinga Link to comment Share on other sites More sharing options...
Martin89 Posted February 18, 2011 Author Share Posted February 18, 2011 Dag Bart, Bedankt voor je reactie.Ik ben er inmiddels uitgekomen, hieronder een stukje script wat voor mij de oplossing heeft geboden:ob_start();global $cart, $cookie, $_CONF, $link;$cookie = new Cookie('ps');if ($iso = Tools::getValue('isolang') AND Validate::isLanguageIsoCode($iso) AND ($id_lang = intval(Language::getIdByIso($iso)))) $_GET['id_lang'] = $id_lang;Tools::switchLanguage();Tools::setCookieLanguage();define('_USER_ID_LANG_', intval($cookie->id_lang));$iso = strtolower(Language::getIsoById($cookie->id_lang ? intval($cookie->id_lang) : 1)); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now