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

[CatalogPromotion] Use Catalog Promotion rule during application #13014

Merged
merged 5 commits into from Aug 31, 2021

Conversation

Zales0123
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations?
Related tickets based on #13001
License MIT

@Zales0123 Zales0123 added the Feature New feature proposals. label Aug 27, 2021
@Zales0123 Zales0123 requested a review from a team as a code owner August 27, 2021 07:25
@probot-autolabeler probot-autolabeler bot added the API APIs related issues and PRs. label Aug 27, 2021
@Zales0123 Zales0123 force-pushed the use-cp-rule-during-cp-application branch from c144119 to d2aafcd Compare August 27, 2021 07:36
@Zales0123 Zales0123 force-pushed the use-cp-rule-during-cp-application branch from d2aafcd to 53a7e9c Compare August 30, 2021 11:15
@Zales0123 Zales0123 force-pushed the use-cp-rule-during-cp-application branch from 53a7e9c to a1378c9 Compare August 30, 2021 11:16
@Zales0123 Zales0123 force-pushed the use-cp-rule-during-cp-application branch from df81536 to 4184f07 Compare August 31, 2021 06:46
@Zales0123 Zales0123 force-pushed the use-cp-rule-during-cp-application branch from 4184f07 to 28e9cb6 Compare August 31, 2021 07:11
@GSadee GSadee merged commit 9b4e162 into Sylius:master Aug 31, 2021
@GSadee
Copy link
Member

GSadee commented Aug 31, 2021

Thank you, Mateusz! 🥇

Comment on lines +49 to +62
/** @var string $variantCode */
foreach ($configuration as $variantCode) {
/** @var ProductVariantInterface|null $variant */
$variant = $this->productVariantRepository->findOneBy(['code' => $variantCode]);
if ($variant === null) {
continue;
}

if (!in_array($variant, $variants)) {
$variants[] = $variant;
}
}

return $variants;
Copy link
Member

Choose a reason for hiding this comment

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

Won't it work?

Suggested change
/** @var string $variantCode */
foreach ($configuration as $variantCode) {
/** @var ProductVariantInterface|null $variant */
$variant = $this->productVariantRepository->findOneBy(['code' => $variantCode]);
if ($variant === null) {
continue;
}
if (!in_array($variant, $variants)) {
$variants[] = $variant;
}
}
return $variants;
return $this->productVariantRepository->findBy(['code' => $configuration]);

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