Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active August 16, 2023 06:13
Show Gist options
  • Save bekarice/54ec1a502a0b9be8e28db52e2e88c41f to your computer and use it in GitHub Desktop.
Save bekarice/54ec1a502a0b9be8e28db52e2e88c41f to your computer and use it in GitHub Desktop.
Automatically link previous orders to new WooCommerce customer accounts upon registration
@djrobinfm
Copy link

Hi,

I've made a big mistake, I'm afraid. People who can buy a LearnDash online course via WooCommerce, were able to check out as a guest in WooCommerce. This wasn't possible before, but an update caused the issue I guess. Anyway: I solved the issue for all new orders, but still: there are several customers who have checked out as a guest, while they must have an account to access the course.

So for those who did check out before as a guest, I want to automatically create an account based on their email addresses.

Is there a way I can run a script like this or something else, that creates accounts for all guest checkouts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment