dualcube / moowoodle

The MooWoodle plugin is an extention of WooCommerce that acts as a bridge between WordPress/Woocommerce and Moodle.
23 stars 22 forks source link

Uses billing email when checking for Moodle user, but user email when creating a new Moodle user #4

Closed lukecarbis closed 4 years ago

lukecarbis commented 9 years ago

Just spent a fair bit of time trying to understand why Moodle users weren't being created when I tested my checkout.

The reason is that Moowoodle uses the billing email provided when checking if the user exists... e.g:

core_user_get_users_by_field: 'email', 'example@foo.bar'

When Moodle returns that no such user exists, Moowoodle attempts to create the user. Only, rather than submitting the same billing email address and user details, it sends the WordPress user details which may be different. In my case, they were. The billing email was different to the WordPress user email.

And when Moowoodle attempts to create the user, the user is either created with the wrong email address, or if the user already exists, an error is returned. This means no enrolment.

The hardest part of this is that it fails silently.

sumandualcube commented 4 years ago

Fixed