Problem/Motivation

If a logged in user buys something, they can't edit their email address during checkout. New Customers can. Ideally, existing customers should be able to edit their contact info. This is particularly useful for allowing administrators to place orders on behalf of others.

Proposed resolution

Provide configuration to allow the contact info (emails) to display on the checkout form for authenticated users if desired.

Remaining tasks

Testing
Extend configuration to be set by role rather than just for all "always"

User interface changes

New configuration item.

Issue fork commerce-2885044

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Greg Boggs created an issue. See original summary.

Juterpillar’s picture

Hi Greg,

I realise this is quite an old issue now, but I required this functionality too. I've attached a very basic patch that provides this functionality. Hopefully it can be of use to someone else too.

RoSk0 made their first commit to this issue’s fork.

rosk0’s picture

Status: Needs work » Needs review

Turned out that we are running this in production for a good five years now! So +1 for RTBC from me.

Created a merge request with the patch from #2.

willardb’s picture

I apologize if this is not the best place for this, but I wanted to say

A) thank you for the patch and
B) although I recognize everything discussed here is for Commerce 8.x-2.x-dev, I am using 3.0.1 as of today and I updated the patch to handle a difference introduced in 3.x in this commit to OrderRefresh.php in 2021. Every time the order is refreshed, the email address for the authenticated user is syncd with the order email, which totally makes sense most of the time. But it doesn't make sense if you're allowing existing customers to update their contact info during checkout, so here's an quick updated patch that comments out the relevant bit in OrderRefresh and includes the rest of the changes provided in the original patch adjusted for a few other insignificant changes for anyone who finds this and is using 3.x.

greg boggs’s picture

Heck yea. Team work in the open source community.

jsacksick’s picture

Version: 8.x-2.x-dev » 3.x-dev
Status: Needs review » Needs work

Instead of commenting out the part where the order email is synced, perhaps we should flag the order from the pane?
So basically, something like:
$order->setData('customer_email_overridden', TRUE);

This way we could skip the email refresh, when this data flag is set?

jsacksick changed the visibility of the branch 3.x to hidden.

  • jsacksick committed 0a7c90c8 on 3.x
    Issue #2885044 by rosk0, jsacksick, Juterpillar, willardb, greg boggs:...
jsacksick’s picture

Status: Needs work » Fixed
willardb’s picture

That is much better in every way. Thank you so much!!

jsacksick’s picture

I'm wondering if I should only set the data flag for logged in customers. Perhaps no need to store extra data for anonymous customers... What do you think?

  • jsacksick committed d925fc45 on 3.x
    Issue #2885044 followup: Only set the 'customer_email_overridden' flag...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.