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 article that documents a Spree::Order journey #2803

Merged

Conversation

benjaminwil
Copy link
Contributor

The initial version of this article tracks a Spree::Order, from before it is created (by a customer adding an item to the cart), to the point when an order is shipped and received by the customer.

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.

Left some questions, thanks!

- If returning, Solidus determines whether the customer is a guest.
- If customer was logged in during a previous session, Solidus determines
whether customer should be logged in again.
- If new, `guest_token` cookie might be generated for the customer.
Copy link
Member

Choose a reason for hiding this comment

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

too much indent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. This was intentional, but I think that it makes more sense to indent these lists this way:

 - If returning, Solidus determines whether the customer is a guest.
    - If customer was logged in during a previous session, Solidus determines
      whether customer should be logged in again.
  - If new, `guest_token` cookie might be generated for the customer.

Because the "If customer was logged in..." item relates specifically to the returning customers item above.


- Customer logs in or continues checkout as a guest.
- The `Spree::Order` is updated.
- If the customer logs into an existing account, their `Spree::User`
Copy link
Member

Choose a reason for hiding this comment

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

maybe we should mention that at this point the order could be merged with a previous user's order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I had overlooked that. I will be adding a new list item to account for this functionality.


- The `Spree::Payment`'s `state` changes from `checkout` to `pending`.

Administrator approves the shipment.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that this is needed actually. I think that shipments become ready when the payment is paid (no balance due), no approval needed.


- The `Spree::Order`'s `approver_id` and `approved_at` values are no
longer `nil`.
- The [`Spree::StockItem`'s][spree-stock-item] `count_on_hand` value decrease by
Copy link
Member

Choose a reason for hiding this comment

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

doesn't this happen when the shipment is shipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will run through an order and double-check this now. Thank you.

My understanding was that a sold stock item is no longer counted as on hand, because it has been sold and will be shipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just ran through an order. The count_on_hand decreases as soon as an order has been placed – so before the shipment is shipped.

The initial version of this article tracks a Spree::Order, from before
it is created (by a customer adding an item to the cart), to the point
when an order is shipped and received by the customer.
@benjaminwil benjaminwil force-pushed the dev_guides/orders/customer_story branch from 0a257a7 to 409d39b Compare July 19, 2018 21:57
@benjaminwil
Copy link
Contributor Author

@kennyadsl Thanks for your comments. I just updated the commit to fix the issues you commented on.


- The `Spree::Order`'s `approver_id` and `approved_at` values are no
longer `nil`.
- The [`Spree::StockItem`'s][spree-stock-item] `count_on_hand` value decrease by
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I still think this should not stay here, doesn't this happen when the order is completed without the need for the admin to do any approval?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, thank you! Fixing.

This commit adds additional headings to the customer flow article. This
allows readers to more quickly skim and scan the article for the
information they are looking for.
Copy link
Member

@gmacdougall gmacdougall left a comment

Choose a reason for hiding this comment

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

Thanks Ben!

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.

This is very useful. Thanks for writing that

@tvdeyen tvdeyen merged commit fc8c072 into solidusio:master Oct 5, 2018
jacobherrington pushed a commit to jacobherrington/solidus that referenced this pull request Oct 7, 2018
…/orders/customer_story"

This reverts commit fc8c072, reversing
changes made to ed9e634.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants