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

Add support for prefill user address in new order #3558

Conversation

jaimelr
Copy link
Contributor

@jaimelr jaimelr commented Mar 18, 2020

Description
Ref #3537
When a new order is created passing a user id we want the address to be prefilled.

This associate the user address (both ship and bill) with the order using update

test_address_issue_solidus

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jaimelr and @JuanCrg90!

I left some comments and I think we should also add some feature specs for this. 🙏

@kennyadsl kennyadsl added changelog:solidus_backend Changes to the solidus_backend gem type:enhancement Proposed or newly added feature Needs Work labels Apr 20, 2020
@jaimelr jaimelr force-pushed the prefill-user-when-creating-new-order-for-specific-user branch from 568abad to 03190a0 Compare May 7, 2020 01:34
@jaimelr jaimelr force-pushed the prefill-user-when-creating-new-order-for-specific-user branch from 03190a0 to cc8acbc Compare May 8, 2020 01:09
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a possible improvement so we can avoid passing the user to the order_params method. Thanks!

backend/app/controllers/spree/admin/orders_controller.rb Outdated Show resolved Hide resolved
@jaimelr jaimelr force-pushed the prefill-user-when-creating-new-order-for-specific-user branch from cc8acbc to 6c03d86 Compare May 14, 2020 19:37
When a new order is created passing a user id we want the address to be
prefilled.

This associate the user address (both ship and bill) by passing the
bill_address and ship_address to the `Spree::Core::Importer::Order` via
order_params.

Co-authored-by: Juan C. Ruiz <[email protected]>
@jaimelr jaimelr force-pushed the prefill-user-when-creating-new-order-for-specific-user branch from 6c03d86 to a3664d7 Compare May 14, 2020 19:50
@aldesantis aldesantis requested a review from a team May 22, 2020 14:43
@jaimelr jaimelr requested review from kennyadsl and removed request for a team May 25, 2020 22:58
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice. Thanks

@kennyadsl kennyadsl merged commit ec07bd8 into solidusio:master Jun 11, 2020
@jaimelr jaimelr deleted the prefill-user-when-creating-new-order-for-specific-user branch June 20, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants