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] Receiving discount promotion #12081

Merged
merged 1 commit into from Nov 26, 2020

Conversation

Tomanhez
Copy link
Contributor

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

@Tomanhez Tomanhez requested a review from a team as a code owner November 24, 2020 09:57
@Zales0123 Zales0123 added API APIs related issues and PRs. Feature New feature proposals. labels Nov 24, 2020

$items = $this->responseChecker->getValue($this->cartsClient->getLastResponse(), 'items');

foreach ($items as $item) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
foreach ($items as $item) {
$productName = $product->getName();
foreach ($items as $item) {
if ($item['productName'] === $productName()) {

in this $product->getName() we will call once but I assume there is not a lot of items in the $items.

Copy link
Contributor Author

@Tomanhez Tomanhez Nov 25, 2020

Choose a reason for hiding this comment

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

You wrong, look in this scenario: features/promotion/receiving_discount/receiving_discount_from_promotion_with_multiple_actions.feature there are two products

src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated Show resolved Hide resolved
@GSadee GSadee merged commit d3164b6 into Sylius:master Nov 26, 2020
@GSadee
Copy link
Member

GSadee commented Nov 26, 2020

Thank you, Tomasz! 🥇

GSadee added a commit that referenced this pull request Nov 26, 2020
This PR was merged into the 1.9-dev branch.

Discussion
----------

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

This PR is based on #12081

<!--
 - Bug fixes must be submitted against the 1.7 or 1.8 branch (the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

25afe06 Add api tags to behats
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

6 participants