Phillys93 Posted September 4, 2013 Share Posted September 4, 2013 (edited) I would like some help with the fundamentals for making a centralized logon (front office) for Prestashop - a separate logon page.I have a Prestashop installation with multiple shops (multistore). I have tried the Webservices API but doesn't find any way to handle logins and session cookies. How do I do this? For example: In my Prestashop I've got three shops with three different URLs, such as: A => mydomain.com/a B => mydomain.com/b C => mydomain.com/c When a customer browses to the URL, mydomain.com (top of domain) a logon page will appear. The user logs in and gets redirected to the shop where he/she is registered. So to get started with my project I would like know how to login a user through a page outside Prestashop. Can I load classes from PS and use them externally? Edited September 4, 2013 by Phillys93 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 4, 2013 Share Posted September 4, 2013 what you exactly mean by "centralized logon" ? you are talking about front office? back office? you want to create separate page? can you shed some light on this case please? Link to comment Share on other sites More sharing options...
Phillys93 Posted September 4, 2013 Author Share Posted September 4, 2013 (edited) Sorry, I have edited my post above now. Please take a look again. Edited September 4, 2013 by Phillys93 (see edit history) Link to comment Share on other sites More sharing options...
Phillys93 Posted September 4, 2013 Author Share Posted September 4, 2013 I tried to retrive cookie data from mydomain.com/login/cookie.php: include_once('../config/config.inc.php'); include_once('../config/settings.inc.php'); include_once('../classes/Cookie.php'); $cookie = new Cookie('ps'); // Use "psAdmin" to read an employee's cookie if(!$cookie->isLogged()){ echo ("Please login"); exit; } else{ echo ("Logged in as: ".$cookie->customer_lastname." ".$cookie->customer_firstname); } Eventough I was logged in at one of my shops (mydomain.com/b) the code (mydomain.com/login/cookie.php) says I'm not logged in. What am I doing wrong? Link to comment Share on other sites More sharing options...
Phillys93 Posted September 4, 2013 Author Share Posted September 4, 2013 (edited) Anyone? I got this to work for the first (default shop) but I'm not able to collect data from the other shops: include_once('../config/config.inc.php'); include_once('../config/settings.inc.php'); include_once('../classes/Cookie.php'); $lastname=Context::getContext()->customer->lastname; if(!Context::getContext()->customer->isLogged()){ echo "Please login"; exit; } else{ echo "Logged in as".$lastname; exit; } Edited September 4, 2013 by Phillys93 (see edit history) Link to comment Share on other sites More sharing options...
trevorgilligan Posted November 28, 2016 Share Posted November 28, 2016 im having a problem with multistore and i think it is cookies / sessions... so MainShop.com/shop is where PS is installed. MainShop.com/shop/ShopA , works perfectly. However cant add to cart and cant log in, when i direct ShopA.com to MainShop.com/shop/ShopA ?? Can anyone help, im losing a lot of clients over this not working! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now