Post by RichMo » Sun Jul 15, 2012 9:54 pm

I do. I sent you the link in pm

New member

Posts

Joined
Tue Jul 10, 2012 5:54 pm

Post by RichMo » Thu Jul 19, 2012 4:28 am

Well I think I sorted it. This is the contents of my test.php file...

Code: Select all

<?
// Version
define('VERSION', '1.5.3.1');

// Configuration
require_once('shop/config.php');

// Startup
require_once(DIR_SYSTEM . 'startup.php');

// Application Classes
require_once(DIR_SYSTEM . 'library/customer.php');

// Registry
$registry = new Registry();

// Database 
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$registry->set('db', $db);

// Request
$request = new Request();
$registry->set('request', $request);

// Session
$session = new Session();
$registry->set('session', $session);  		


// My stuff Below -------
$customer = new Customer($registry);  
$logged = $customer->isLogged();
$firstName = $customer->getFirstName();

if (!$logged) {
	echo "You must be logged in to view this page! Please Register or Login!";
} else {
	echo $firstName." is logged in";
}

?>
I pasted the entire index.php file from opencart then cut out the bit that outputs the site. I then just create an instance of the Customer class and got the data from that.
I've then bit by bit cut out all the code that seemed not to be needed. and the above is the least i can get it down to without any errors or warning showing up.
I hope this will be of use to others.
If anyone can see a mistake or if there is something important I've removed, please let me know.

New member

Posts

Joined
Tue Jul 10, 2012 5:54 pm

Post by StoneColdMagic » Sat Sep 01, 2012 7:53 am

RichMo,

Thanks for the code. I'm actually trying to do the exact same thing except I want to verify that the affiliate is logged in rather than the user.

I've dug through the code and have no idea what I'm looking for.

The big difference between what you've done and what I need, however, is that I'll be within the structure of the OpenCart system, so all I really need to know is what is the variable used to validate the affiliate.

The user variable was $logged . . . is there an equivalent for the affiliate login info?

I'm using ver 1.5.3.1

Thanks,

Jeffro


Posts

Joined
Tue Jul 24, 2012 1:40 am
Who is online

Users browsing this forum: No registered users and 4 guests