-
-
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
[Catalog Promotion][Docs] update CP scopes docs #13591
Conversation
AdamKasp
commented
Feb 3, 2022
Q | A |
---|---|
Branch? | 1.11 |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
License | MIT |
arguments: | ||
- '@sylius.repository.product_variant' | ||
tags: | ||
- { name: 'sylius.catalog_promotion.variants_provider', type: 'by_phrase' } | ||
- { name: 'sylius.catalog_promotion.variant_checker', type: 'for_phrase' } |
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.
- { name: 'sylius.catalog_promotion.variant_checker', type: 'for_phrase' } | |
- { name: 'sylius.catalog_promotion.variant_checker', type: 'by_phrase' } |
{ | ||
public const TYPE = 'by_phrase'; | ||
public const TYPE = 'for_phrase'; |
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.
public const TYPE = 'for_phrase'; | |
public const TYPE = 'by_phrase'; |
Thank you, Adam! 🎉 |
return in_array( | ||
$productVariant, | ||
$this->productVariantRepository->findByPhrase($configuration['phrase'], 'en_US'), | ||
true | ||
); |
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.
It will do almost similar thing(we will not check by code and english locale is not guaranteed), but lets not encourage to load additional data from db at this stage
return in_array( | |
$productVariant, | |
$this->productVariantRepository->findByPhrase($configuration['phrase'], 'en_US'), | |
true | |
); | |
return str_contains($productVariant->getName(), $configuration['phrase']); |
… (GSadee) This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.11 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | resolves comments from #13591 | License | MIT <!-- - Bug fixes must be submitted against the 1.10 or 1.11 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 ------- 4e15ce3 [Cookbook] Minor fixes in custom catalog promotion scope