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

Skip to content

[CatalogPromotion] Clear applied catalog promotions after updating#13100

Merged
Zales0123 merged 2 commits into
Sylius:masterfrom
GSadee:api-reapplying-catalog-promotions-channels
Sep 14, 2021
Merged

[CatalogPromotion] Clear applied catalog promotions after updating#13100
Zales0123 merged 2 commits into
Sylius:masterfrom
GSadee:api-reapplying-catalog-promotions-channels

Conversation

@GSadee
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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.

3 participants