Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Api] Receiving discount promotion#12081

Merged
GSadee merged 1 commit into
Sylius:masterfrom
Tomanhez:reciving-discount-promotion
Nov 26, 2020
Merged

[Api] Receiving discount promotion#12081
GSadee merged 1 commit into
Sylius:masterfrom
Tomanhez:reciving-discount-promotion

Conversation

@Tomanhez
Copy link
Copy Markdown
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
@Tomanhez Tomanhez force-pushed the reciving-discount-promotion branch from 79a333a to 0ddad77 Compare November 24, 2020 10:15
Comment thread src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated

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

foreach ($items as $item) {
Copy link
Copy Markdown
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
Copy Markdown
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

@Tomanhez Tomanhez force-pushed the reciving-discount-promotion branch from a2cef23 to 5c28552 Compare November 25, 2020 20:11
Comment thread src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated
Comment thread src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated
Comment thread src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated
Comment thread src/Sylius/Behat/Context/Api/Shop/CartContext.php Outdated
@Tomanhez Tomanhez force-pushed the reciving-discount-promotion branch from 5c28552 to 377a445 Compare November 26, 2020 09:52
@GSadee GSadee merged commit d3164b6 into Sylius:master Nov 26, 2020
@GSadee
Copy link
Copy Markdown
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.

6 participants