Is there a php command that can delete the logged in member's account?
Like a CLI command? Could you give some context?
I want to be able to give the customer the option to checkout as a guest, and at the moment, it automatically creates a log in for them with a password. So I want to do it so that when the order is complete, the account is deleted.
See the example here: https://docs.grabaperch.com/addons/shop/examples/no-account/
I've already done that. I want to be able to automatically delete the account
That is not something we would advise.
My client is asking for it. If a customer checks out as a guest at the moment and they later on want to place another order, it says that they have already created an account. They want to avoid this
Deleting member accounts is not the way to do that.
If that's what your client is asking for, then it's up to you to judge if that's a good solution, but it's not something we can offer you support for as it's not how the software is designed to work.
Do you have an alternative solution then?
Yes, not deleting the account. The solution is outlined in the documentation I linked to.
If you're having a specific problem, feel free to raise a thread about it, that's fine, and we'll try to help. I'm not going to advise you to start deleting parts of data that will essentially break your shop, no matter how much your client wants that.
So after the checkout, and the customer doesn't want to ‘adopt’ their account, how can they checkout as a guest again?
As long as they've been logged out, then they should just be able to repeat the process.