Last question I think forever. My store requires users to have an account, so during the account creation I pass all the user info to the API. This is working fine. My problem is coming from the SSO. I'm trying to get the user's email or username to grab the foxycart_customer_id from my database, but I'm having trouble knowing how to run the SQL query on the currently logged in user. I wanted to pass a $_SESSION, but it seems that when I go to the checkout the $_SESSION is not longer available. So I'm wondering how to pass some form of who is logged in, to my SSO file. I know I can make a hidden input with the value of their username, but I still don't know how to access this on the SSO file.
Here's the code I got from the wiki.
$user_is_authenticated = true;
// Put in your FoxyCart api / datafeed access key here.
// This value should match the value setup in your
// FoxyCart admin under "advanced".
$foxycart_api_key = '#########';
// Put in your full foxycart store domain here.
$foxycart_domain = 'integra.foxycart.com';
// If the user is not logged in, do you still want to
// allow them to proceed to checkout?
$allow_non_auth_checkout = false;
// if not, you must specify a redirect page (such as your login page?)
$redirect_url = 'http://integra-adhesives.com/shop/login/';
// Put in your database query or session variable here
// for the current logged in user's FoxyCart customer_id
$host = localhost;
$dbshop = ###;
$user = ###;
$pass = ###;
// GET FROM EDIT
// Does not work
//$u_user = $_SESSION['user'];
$dbh = new PDO("mysql:host=$host;dbname=$dbshop",$user,$pass);
$dbh -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$stmt = $dbh -> prepare('SELECT foxy_customer_id FROM customers WHERE u_user = "'.$u_user.'"');
$stmt -> execute();
$row = $stmt -> fetch();
$foxycart_customer_id = $row['foxy_customer_id'];
Any thoughts on how to grab this?