I'm building a store website, where a customer service department is also using the site on the back end to take in some orders via phone or fax. I've configured my site so that user accounts are not created when orders are placed.
If a user is authenticated, it doesn't ask them for their email address during the checkout phase, it assumes the logged in UserID. There is a permission to "Display the account information pane for authenticated users. " in the checkout settings, but it doesn't allow you to change the email address.
Is there any way to force anonymous checkout? That is, I want authenticated users to re-enter in email information so that a new customer profile is created for ever order, and that the profile email can subsequently be used to send mail to the profile, rather than the user.
Thanks in advance!
Comments
Comment #1
TrevorBradley CreditAttribution: TrevorBradley commentedGot it! Figured out just the right combination of hook_form_alter. The culprit function is actually commerce_order_account_pane_checkout_form, but the way the alter functions are layered makes it very difficult to insert the solution without hacking commerce directly.
Now, the account user information is still set in the profile, but I don't care, I can hide that...
I'd appreciate if anyone else could have a look at this and figure out if there was a better solution.
Comment #2
TrevorBradley CreditAttribution: TrevorBradley commentedOK, I think I've figured out the *right* way to do this.
I've moved all the functions in commerce_order.checkout_pane.inc into my own module, and prefixed the function names. I then attached to the hook in commerce_checkout_panes as follows:
I then can hack the commerce_order_account_pane at will, because I'm actually hacking MYMODULE_commerce_order_account_pane.
Whew! That was hard, but I think it's finally right.