Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Order#order_email to show the order's email #5596

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

softr8
Copy link
Contributor

@softr8 softr8 commented Jan 15, 2024

Summary

spree_orders table has the column email which stores the email of guest orders, this change intends to look first at this property then fallback to user's email.

This approach also makes it easier to stores to override what email to show.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@softr8 softr8 requested a review from a team as a code owner January 15, 2024 19:19
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_admin labels Jan 15, 2024
`spree_orders` table has the column `email` which stores the email of
guest orders, this change intends to look first at this property then
fallback to user's email.
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (be710f3) 88.58% compared to head (deed35a) 88.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5596   +/-   ##
=======================================
  Coverage   88.58%   88.58%           
=======================================
  Files         685      685           
  Lines       16404    16406    +2     
=======================================
+ Hits        14531    14533    +2     
  Misses       1873     1873           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jarednorman
Copy link
Member

I'm not necessarily opposed to this change, but can you provide some more context? In all the stores I work on, the order email gets set to the user email for non-guest orders, so I'm not sure how much value this provides.

@softr8
Copy link
Contributor Author

softr8 commented Jan 16, 2024

I'm not necessarily opposed to this change, but can you provide some more context? In all the stores I work on, the order email gets set to the user email for non-guest orders, so I'm not sure how much value this provides.

I have some apps that behave like PoS, where a logged-in user can create orders for others, this is just the view layer, it does not change anything at all, The previous admin used to render order.email instead of order.user&.email || order.email

@jarednorman
Copy link
Member

How does users creating orders for others factor in? Shouldn't that use the created_by field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants