My opencart shop is installed as "example.com/shop", and I would like to be able to use the opencart login to allow access to other parts of my site. i.e. pages that are not within the /shop/ directory.
Is this possible?
For example, in a page such as example.com/example.php...
if (user is logged on) {
echo "Welcome Username";
} else {
echo "Welcome Guest, please log in";
}
I've tried the following code in a file (example.com/test.php), but I think I must need to call some functions first, but I'm not sure where to start... (it says logged is undefined)
Code: Select all
<?
// This file is example.com/test.php
// Shop is at example.com/shop/
include_once ("shop/config.php");
include_once ("shop/system/startup.php");
if (!$logged) {
echo "You are NOT logged in";
} else {
echo "You are logged in";
}
?>