14004 link correct customer to order#14008
Conversation
f8f3ac2 to
bca5ee2
Compare
dacook
left a comment
There was a problem hiding this comment.
Great, glad that was a simple fix!
| attr_reader :order, :distributor, :current_user | ||
|
|
||
| def reset_user_and_customer(current_user) | ||
| def reset_user(current_user) |
There was a problem hiding this comment.
That was a badly named method! I guess something got changed but the method name stayed the same.
There was a problem hiding this comment.
Indeed, once upon a time it called associated_customer on the order.
mkllnk
left a comment
There was a problem hiding this comment.
Great! I'm just wondering if it's possible that there is not customer record yet. We don't want to keep the old customer record in that case, do we?
| reset_user_and_customer(current_user) | ||
| reset_user(current_user) | ||
| reset_order_cycle(current_customer) | ||
| order.customer = current_customer if current_customer.present? |
There was a problem hiding this comment.
What if it's not present? Maybe you don't have a customer record yet. Should we set it to nil?
There was a problem hiding this comment.
True, for instance if you log out after placing an order and start a new order as a guest we end up the scenario where the order has a customer but system doesn't have a current customer.
Fixed here : d706b3a
| reset_user_and_customer(current_user) | ||
| reset_user(current_user) | ||
| reset_order_cycle(current_customer) | ||
| order.customer = current_customer if current_customer.present? |
There was a problem hiding this comment.
| order.customer = current_customer if current_customer.present? | |
| order.customer = current_customer |
What? Why?
After placing an order shop A, and starting a new order on shop B, the order stayed linked to customer from shop A. This PR update the
CartResetServicelogic to properly update the customer when switching shop.What should we test?
--> you should see "Shop B" as first name for the billing address.
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates