solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Adds Order#order_email to show the order's email

Open softr8 opened this issue 2 years ago • 4 comments

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 avatar Jan 15 '24 19:01 softr8

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 15 '24 22:01 codecov[bot]

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.

jarednorman avatar Jan 16 '24 01:01 jarednorman

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

softr8 avatar Jan 16 '24 18:01 softr8

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

jarednorman avatar Jan 16 '24 21:01 jarednorman