Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi store multi domain one checkout, single customer login into all stores?

I am running Opencart v2.3.0.2 multi store on several domains (not sub-domains) and want to Checkout on main site, which has all the products from all the stores.

Since it is hard to share sessions on multiple domains, think it is best to force user login before the Checkout process (login credentials are same for all stores and Cart items are shared). But, by default, users have to login into each store separately - how can I create single login into/for all stores? Once logged in, I can send them to main site to checkout.

If you think there is a better way for single checkout, please suggest.

like image 823
skobaljic Avatar asked Feb 15 '17 14:02

skobaljic


2 Answers

If its enough for you to simply login your user in all stores (and you don't wont to use same session id) you can

1) implemented login link locking for all your stores

2) after successful login to one of your stores in response send him back all rest stores login links

3) execute each login link by ajax.

so as result you will login to one fore but automatically login to all stores

NOTE: best will be if your login form itself will be also by ajax so user will simply enter credentials and in case of success see longer ajax load during which you will one by one execute rest login links

like image 108
Armen Avatar answered Nov 15 '22 01:11

Armen


What you want is Single Sign On. There are many ways to do that, one more secure way is to use JSON Web Token (like https://github.com/lcobucci/jwt). In short, these are signed JSON strings so you use the power of asynchronous encryption! ;)

like image 32
Salic Avatar answered Nov 15 '22 03:11

Salic