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] Clear applied catalog promotions after updating #13100

Merged

Conversation

GSadee
Copy link
Member

@GSadee GSadee commented Sep 14, 2021

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

@GSadee GSadee added Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). API APIs related issues and PRs. labels Sep 14, 2021
@GSadee GSadee requested a review from a team as a code owner September 14, 2021 08:49
@GSadee GSadee force-pushed the api-reapplying-catalog-promotions-channels branch from 10c5546 to 19f06a3 Compare September 14, 2021 09:04
public function findWithDiscountedPrice(): array
{
return $this->createQueryBuilder('o')
->andWhere('o.originalPrice IS NOT NULL')
Copy link
Member

Choose a reason for hiding this comment

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

What if somebody manually set the original price as equal to the price? It can happen 😄 maybe additional ->andWhere('o.originalPrice > o.price) would do the trick?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because of that, I've added an additional check if the applied promotions are not empty: https://github.com/Sylius/Sylius/pull/13100/files#diff-5f3a950780ee137f6c0dbe75d71b3ef264f25fbb5d634b9ec463fdab7b1b5819R37
Wouldn't it be enough for now?

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough for the merge, but would be good to add that where too in the nearest future 🖖

@Zales0123 Zales0123 merged commit 2d9f497 into Sylius:master Sep 14, 2021
@Zales0123
Copy link
Member

Thank you, Grzegorz! 🥇

@GSadee GSadee deleted the api-reapplying-catalog-promotions-channels branch September 15, 2021 05:03
AdamKasp added a commit that referenced this pull request Sep 15, 2021
…icings (GSadee)

This PR was merged into the 1.11-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes #13100 (comment)
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.9 or 1.10 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
-------

c69e751 [ChannelPricing] Improve query for finding discounted pricings
AdamKasp added a commit to Sylius/SyliusCoreBundle that referenced this pull request Sep 15, 2021
…icings (GSadee)

This PR was merged into the 1.11-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes Sylius/Sylius#13100 (comment)
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.9 or 1.10 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
-------

c69e7518581cc1f3d784570784bec5926861d95c [ChannelPricing] Improve query for finding discounted pricings
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. Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants