-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Cart][Core] Rework the logic behind the cart #5565
[Cart][Core] Rework the logic behind the cart #5565
Conversation
Arminek
commented
Jul 21, 2016
Q | A |
---|---|
Bug fix? | yes |
New feature? | yes |
BC breaks? | yes |
Related tickets | #5197 |
License | MIT |
try { | ||
$cart = $this->cartContext->getCart(); | ||
} catch (CartNotFoundException $exception) { | ||
$cart = null; |
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.
return?
01e2f5f
to
874ca1c
Compare
To have it more visible. Any chances / maybe it is worked on multiple orders per cart? #5566 |
@Mr-Negative IMO we should rework basic cart logic I don't think that multiple orders are our goal now. |
24e671b
to
e2aef46
Compare
@@ -57,4 +63,5 @@ | |||
</call> | |||
</service> | |||
</services> | |||
|
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.
Redundant
37567b3
to
1d987fa
Compare
6314dcc
to
ac2ec89
Compare
@@ -58,19 +58,19 @@ protected function getCartSummaryRoute() | |||
protected function getCurrentCart() | |||
{ | |||
return $this | |||
->getProvider() | |||
->getContext() | |||
->getCart() | |||
; |
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.
I guess we can make it an one-liner.
Great job! Thanks @pjedrzejewski and @Arminek! 👍 |
@Arminek please apply all comments in a separate PR. |
@@ -36,39 +40,40 @@ function it_is_initializable() | |||
} | |||
|
|||
function it_recalculates_cart_for_logged_in_user( | |||
CartProviderInterface $cartProvider, | |||
CartContextInterface $cartContext, | |||
Event $event, | |||
OrderInterface $order, | |||
OrderRecalculatorInterface $orderRecalculator |
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.
Should be the second one (it's the collaborator injected into constructor).
…ng-refactoring [Cart][Core] Rework the logic behind the cart