Hi, I have a chunk of code in the Page_Controller on a page type called TourPage, that checks a $_GET value in the URL (from a form submission) and uses that value to set a default currency in the Cookie. (Default is set in Page init()). Code as follows:
class Tour_Controller extends Page_Controller {
function init() {
parent::init();
// If a currency has been selected, update cookie to keep track of user preference
$VivaCurrencyCookie = new Cookie;
if($_GET['viva_cur']) {
$VivaCurrencyCookie->set('viva_currency', $_GET['viva_cur']);
}
}
}
I've tested this and it works fine. But I am unable to work out how to access that cookie value on the template itself. I want to use the cookie value in if conditions to display the correct price. How can you access (or pass to the main class) a variable calculated in a controller?
Cheers
Aaron