I am new to opencart. I have my basic php code at http://localhost/testphp
and my opencart is installed at http://localhost/opencart
. What I want to do is that in testphp
, I have a page in which I want to check that if any user is logged in or not at opencart
.
If it is logged in then I want to perform x function
and It not logged in then want to perform y function
I have tried to logged in to opencart and tried to print_r($_SESSION)
in testphp.
It is returning blank. How can I perform this ? Please help me
If you are using localhost then you can try this. or same hosting account or cpanel
Go to catalog/controller/common/header.php
Before "public function index() {" Add this code
You Have to Print Array in
http://localhost/testphp
Code :Your Output Will be