Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active December 16, 2024 05:07
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?

@alprio
Copy link

alprio commented Oct 21, 2024

so it works, if someone makes an account , their orders will be linked, but if then logs out and make an order as a guest and then he logs in again , this order will no be linked.

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