- Issue created by @j.
- 🇳🇴Norway eiriksm Norway
Well it has to be assigned to be able to continue to check out that order, yes. Does the order assigner need to overwrite the email? I guess not, but that would be an issue for the commerce project :)
Totally open to looking at a patch for it, where we can compensate for that in this module, if you are able to whip that up? 🤓
Thank you for clarify that the assigning is necessary. I will be happy to work on a patch and i might post this as an issue on the commerce project as well.
- Status changed to Needs review
about 2 years ago 3:29pm 5 April 2023 Here's a go at a patch for this.
I replaced the call to commerce's assign method with modification of it that leaves email untouched in the case of anonymous users. I'm not sure if the OrderAssignEvent is needed in this case, but left it since i'm still new to what all this is doing and don't want to break anything. I did remove the optional $save_order parameter from the original function and defaulted to saving the order because i was unsure how to make it optional in this case.
I manually tested it for an anonymous and a user with an account. The checkout link worked correctly and the order went through for both.
- 🇳🇴Norway eiriksm Norway
Thanks for the patch! 🤓
Hm, I would rather use the assigner service directly and you can suggest your change in commerce directly.
However, I have a different suggestion that would solve your problem. What if you implemented a listener for the order assign event in a custom module? You could just set the customer (and their email) from there?
If i implement a listener for the order assign event and do my own setting of customer/email does it skip implementing commerce's?
- Status changed to Closed: works as designed
over 1 year ago 5:17pm 15 September 2023 Thank you for the tips. I implemented your suggestions and have a working solution. Closing this issue now.