This is probably a dumb question, but I can't figure out what method to use to display the e-mail address associated with the customer's order on the actual Order View. The only way I can see it in the UI is to click "Edit" and then scroll down to the bottom of the page and look in User Information.
Is this a theme thing? A preprocess thing? I'm sure that once I'm pointed in the right direction I could figure it out but I've looked all over and I'm stuck.
See the attached screenshot. This is a testing order with fake info on my dev site. All I want to do is add the e-mail address associated with the order to that list of info, so that my staff and I can contact the client more efficiently if necessary.
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | interdiff_33-34.txt | 1.11 KB | danmer |
| #34 | add-email-field-2846893-34.patch | 4.54 KB | danmer |
| #33 | add-email-field-2846893-33.patch | 4.41 KB | danmer |
| #27 | 2846893-27.patch | 1.75 KB | aryashreep |
| #27 | interdiff-2846893-19-27.txt | 1.9 KB | aryashreep |
Comments
Comment #2
umeshsapariya commentedWe will work on this issue in Drupal code sprint #16
Comment #3
TynanFox commentedExcellent, thanks! :)
Comment #4
shylajaphp commentedHi,
I am working on this issue,DrupalMumbaiCodeSprint16
Comment #5
shylajaphp commentedHi TynanFox,
Please review the attached patch and let me know
Comment #6
shylajaphp commentedComment #7
shylajaphp commentedHi TynanFox,
Please apply the attached patch and let me know
Comment #8
rszrama commentedThis is not a good solution, as it's just randomly dropping the e-mail address on a custom profile field rendering. It really should be its own extra field with its own positioning / markup.
Comment #9
shylajaphp commentedHi rszrama,
Thank you very much for your review. i will implement your comment.
Comment #10
shylajaphp commentedComment #11
TynanFox commentedThank you all for working on this!
I'll be happy to review the reworked patch
Comment #12
shylajaphp commentedHi rszrama / TynanFox,
Kindly review the attached patch. Waiting for your response.
Comment #13
shylajaphp commentedComment #14
shylajaphp commentedComment #15
shylajaphp commentedComment #16
shylajaphp commentedHi rszrama / TynanFox,
Please review the attached patch. Waiting for your response.
Comment #17
rszrama commentedSorry, this is not what I meant when I said "extra field." That's an actual Drupal 7 concept for entity properties that can be repositioned / hidden through the field display configuration form. Please see the following docs:
https://api.drupal.org/api/drupal/modules%21field%21field.api.php/functi....
Comment #18
shylajaphp commentedHi rszrama,
Thank you for your review. I will do it.
Comment #19
shylajaphp commentedHi rszrama / TynanFox,
Please review the attached patch. Waiting for your response.
Comment #20
shylajaphp commentedComment #21
sonoutlaw commentedPatch works great.
Comment #22
jeetendrakumar commented@shylajaphp, the patch is not following Drupal coding standards.
Your patch is having more than 2 spaces etc. More info..
Kindly update the patch.
Comment #23
aryashreep commented@shylajaphp, thanks for picking this up. Can you also provide an iterdiff? This greatly helps to review the changes you made without re-evaluating the whole patch.
See: https://www.drupal.org/documentation/git/interdiff
Comment #24
aryashreep commentedComment #25
aryashreep commentedUpdated the patch as per comment #22 with Drupal coding standard and added a new line at the bottom.
Drupal Global Sprint Weekend 2018
[ Asia ]
[ India ]
Comment #27
aryashreep commentedUpdated the patch.
Drupal Global Sprint Weekend 2018
[ Asia ]
[ India ]
Comment #28
lizzjoyUpdated issue tag (removed #)
Comment #29
TynanFox commentedWow - that really looks great, thanks! It's exactly what I needed!
Comment #30
aryashreep commentedHi TynanFox,
Can you please review the #27 and move to RTBC.
Thank you.
Comment #31
TynanFox commentedWorks great, thanks!
Comment #32
rszrama commentedThe attached patch heads in the right direction using an extra field, but it should just be named 'order_mail' with a label of 'Order email address.' The description doesn't need to say it's a field ... can just be 'The email address entered for this order during checkout.'
We also need to reproduce the same "hack" here that we used in the product reference module to hide the order email address field from entity views until it's explicitly enabled. It would be odd for it to suddenly show up unannounced. : )
Finally, the hook_entity_view() implementation should be fixed up a bit. The docblock has an extra underscore and it should really be referencing a theme function - ideally with a coordinating .tpl.php file, so the field output can be easily overridden in the theme layer. In this patch, if you don't like the output, you have to work extra to override this implementation.
Comment #33
danmer commentedHello, I have improved the patch from #27 according to #32.
Comment #34
danmer commentedHere is a small improvement for the patch.
Comment #35
khiminrm commentedTested patch from #34 with latest dev version of the commerce module on existing site. It works. Display settings of an order view mode should be saved after applying the patch to show email field on an order view page.
Comment #36
rszrama commentedI like the way this came together with regard to ensuring it doesn't just randomly appear on existing sites after the upgrade. The only weird thing about it is that the display settings form shows the extra field as "Visible" even if it hasn't been saved yet, but we'll just have to document the inconsistency. I'm going to add an update function that just exists to show an informational message in that regard.
I also changed my mind re: the labels given these should match what the customer sees on checkout. I updated it to use "E-mail address".
Finally, while e-mail address validation ought to remove any malicious characters, I still think it best to filter the user input through
check_plain()when passing it to the theme function.Thanks again! Committing now.