-
Notifications
You must be signed in to change notification settings - Fork 89
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
Double cart fix #401
Double cart fix #401
Conversation
@lchrusciel This is the current best fix. What do you think? The other approach would be to use a different context that does't automatically create a cart or exclude the cart pickup form those routes. Which I both find not optimal. |
If I understood you correctly, the main issue is with PS. Sorry, for misclick and closing PR :) |
Correct, the |
Alternatively you could also remove the This also fixes the problem in a different place. Currently with the service enabled you get a cart whenever you log in. Even if you never have ever put something into the cart or visited the cart overview once. So this fix also reduces the overhead on any logged in request. |
The easier way would be to fix the sylius cart context. For more information see (Sylius#401)
Thanks, @mamazu! 🥇 |
|
||
$response = $this->client->getResponse(); | ||
|
||
$this->assertResponse($response, 'cart/deprecated_empty_response', Response::HTTP_CREATED); | ||
} | ||
|
||
/** | ||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💖
Big thanks! |
@@ -63,5 +63,10 @@ | |||
<argument type="service" id="validator" /> | |||
<argument type="service" id="tactician.commandbus" /> | |||
</service> | |||
|
|||
<!-- Removing the create cart context from composite context (see: https://github.com/Sylius/Sylius/issues/10192) --> | |||
<service id="sylius.context.cart.new" class="Sylius\Component\Order\Context\CartContext"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if a project use in the same project shop bundle and shop api? This create cart context is removed for both context, isnt'it?
This how I understand your comment Sylius/Sylius#10192 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use the shop front-end and the API as well those will collide. Or so we think. I have not tested it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we also have a ticket for removing the shop from the API package as a dependency (#264)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tophsic that's correct, right now ShopApi will collide with default shop implementation
…assignment (lchrusciel) This PR was merged into the 1.0-dev branch. Discussion ---------- Closing #401, #259 and #406 Commits ------- f80d609 [Customer] Refactor customer assignment to command bf72278 [Cart] Simplify cart recalculation after customer cart assignment e97cd65 [Cart] Auto assign customer to cart during cart pick up
This fixes #393
In this pull request I introduced a new Request and Command object for picking up a cart of a customer that is logged in. This way I registered a new handler. The
PickupLoggedInCart
Command and Request object inherit from the "non logged in"-version.