Jump to content

automatically perform tasks when user is logged out for session expiration (ps 1.3.7)


allienato

Recommended Posts

version: prestashop 1.3.7

hi, I have a custom guest checkout which creates fake customer accounts (as normal registration do, but is hidden for users).
- unregistered user build his own cart
- in the cart summary he goes to checkout
- in the next step he have to fill some required informations like name, address, etc..
- when he clicks on "next", system creates a fake account and the user is logged in with that
- next step is payment...

I would like to perform some delete queries (that affects all the references of this fake account, like in ps_customer, ps_orders, etc..) when this "fake user" is logged out by the expiration of session, in order to automatically delete the account from database when shopping is over.

so, how can I perform some sql tasks when this user closes the browser or session expires? it could be a good solution, instead of have to delete these accounts manually?

thanks, hope someone could give me some advices

Link to comment
Share on other sites

My idea is just set up a cron to delete all the customers that are guests and are older than a day.
this cron can run daily. the guests anyway can't guess the hidden pass and a day it's not a big deal

Link to comment
Share on other sites

yeh could be a good idea I can consider, thank you

but I think it's better to run it when user is logged out for the first time, because my guest checkout system has an "issue":
when prestashop creates the fake account, if user is logged out and tries to re-fill informations before payment (name, address, mail...) system returns an error like "there's already a user registered with that mail address".

so I have to manually delete the account (or remove that control and let create another fake account with same mail address but.. it's not so good)

can I set up a cron like that? I guess I would be able to know if session is expired, then perform delete tasks

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...