Okie, I did a test and find out it's a bit simpler that I thought, still have some small problems tho:
in your includes/templates/your_template/jscript
Create a new file called jscript_check.php with the following content:
PHP Code:
<script type="text/javascript"
src="jscript_check.php">
</script>
Now in the store root folder (the folder that contains "includes" folder)
Create a new file called jscript_check.php with the following content:
<?php
require('includes/application_top.php');
$_SESSION['js_on'] = true;
?>
That's it. However, for some reason, the sessions is only set on the 2nd load of the page. So say if the customer lands on the site, and then visit another page or refresh the page --> the session is set.
It can be something to do with the require('includes/application_top.php'); since it executes lots of things and slows down the whole script.
One thing you can do is: you have to go in and see how zen session is init, and you have to only take the part that init the session.
I tried in the js file:
PHP Code:
<script type="text/javascript"
src="jscript_check.php?zenid=<?php echo zen_session_id(); ?>">
</script>
and then in the php file:
PHP Code:
<?php
session_name('zenid');
if (isset($_GET['zenid']))
session_id($_GET['zenid']);
session_start();
$_SESSION['js_on'] = true;
?>
The zenid is passed in correctly but the session is not. So yeah, let me know if you get it working.
Regards.