chokybp Posted December 13, 2011 Share Posted December 13, 2011 i'm testing with iso vi and i'm trying to get correct cookie->id_currency after page reload. here is my code. $url_currency_code = Tools::getValue('isolang'); if($url_currency_code=='es') $url_currency_id = 1; if($url_currency_code=='vi') $url_currency_id = 2; echo $cookie->id_currency; // display 1 or 2 //$cookie->id_currency = 2; // this work $cookie->id_currency = $url_currency_id; // but this not work (i am sure $url_currency_id is 2) $currency = Tools::setCurrency(); echo $cookie->id_currency; // display 2 the problem is first $cookie->id_currency, the second is ok. the problem is very strange how program work with (2) but not with variable setted from $_GET with the same value and type. Link to comment Share on other sites More sharing options...
doekia Posted December 13, 2011 Share Posted December 13, 2011 the something condition was not met? Best, (d)oekia Link to comment Share on other sites More sharing options...
chokybp Posted December 13, 2011 Author Share Posted December 13, 2011 i edit my post Link to comment Share on other sites More sharing options...
doekia Posted December 13, 2011 Share Posted December 13, 2011 So, you want the value to be 2 and you have 2 ... Don't see any question here. My suggestion: have some sleep Link to comment Share on other sites More sharing options...
chokybp Posted December 14, 2011 Author Share Posted December 14, 2011 the problem is when i set it from Tools::getValue('isolang'); to be 2, cookie->id_currency after refresh is 1 not 2. But when i test to set it directly //$cookie->id_currency = 2; not from variable it work. I want to set it from Tools::getValue('isolang'); or $_GET['isolang'] . Looks crazy, i don't know what is the problem with setting from variable that is from $_GET not directly. I try with (int) and (string) casting but with no effect. Link to comment Share on other sites More sharing options...
chokybp Posted December 18, 2011 Author Share Posted December 18, 2011 Finaly i found the problem. I can't set it from get['id_currency'] because somewhere in my code there is ajax that doesn't provide $_GET['id_currency'] and set variable to null. Link to comment Share on other sites More sharing options...
Recommended Posts