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

[API] Seeing promotions total in cart #11971

Merged
merged 3 commits into from Oct 30, 2020

Conversation

arti0090
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
License MIT

@arti0090 arti0090 added Feature New feature proposals. API APIs related issues and PRs. labels Oct 28, 2020
@arti0090 arti0090 requested a review from a team as a code owner October 28, 2020 11:01
@AdamKasp AdamKasp changed the title [API]seeing promotions total in cart [API] Seeing promotions total in cart Oct 28, 2020
{
Assert::same($this->responseChecker->getValue($this->client->getResponse(), 'orderPromotionTotal'), 0);
if ($this->sharedStorage->has('cart_token')) {
Copy link
Member

Choose a reason for hiding this comment

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

Does this if makes sense? I would assume that cart_token is always set (as we always have cart declared).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because it depends on context where it was started. If steps are all in checkout then they are using $this->client->getResponse() but some steps from cartContext are finished here and those steps are using sharedStorage.

);

Assert::same($discount, (int) $discountTotal);
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of else, can we make early return?

@GSadee GSadee merged commit 2a99e0d into Sylius:master Oct 30, 2020
@GSadee
Copy link
Member

GSadee commented Oct 30, 2020

Thanks, @arti0090! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs. Feature New feature proposals.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants