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

Skip to content

[API][CatalogPromotion] Reapplying catalog promotions on rule update#13129

Merged
AdamKasp merged 6 commits into
Sylius:masterfrom
SirDomin:reapply-cp-after-rule-change
Sep 29, 2021
Merged

[API][CatalogPromotion] Reapplying catalog promotions on rule update#13129
AdamKasp merged 6 commits into
Sylius:masterfrom
SirDomin:reapply-cp-after-rule-change

Conversation

@SirDomin
Copy link
Copy Markdown
Contributor

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

@SirDomin SirDomin requested a review from a team as a code owner September 21, 2021 21:56
@probot-autolabeler probot-autolabeler Bot added the API APIs related issues and PRs. label Sep 21, 2021
@SirDomin SirDomin force-pushed the reapply-cp-after-rule-change branch 2 times, most recently from 80cdd3a to b2f86a2 Compare September 21, 2021 22:57
Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml Outdated
Comment thread src/Sylius/Bundle/CoreBundle/EventListener/CatalogPromotionEventListener.php Outdated
@SirDomin SirDomin force-pushed the reapply-cp-after-rule-change branch 5 times, most recently from 45ea582 to 1befd29 Compare September 23, 2021 07:23
Copy link
Copy Markdown
Member

@GSadee GSadee left a comment

Choose a reason for hiding this comment

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

As we have the possibility to define more than one, I would be for adding another scenario for checking reapplying after adding a second rule to catalog promotion that already has one defined

@SirDomin SirDomin force-pushed the reapply-cp-after-rule-change branch from 454f1d0 to f2fedce Compare September 26, 2021 09:25
return $this->createQueryBuilder('o')
->andWhere('o.originalPrice IS NOT NULL')
->andWhere('o.originalPrice > o.price')
->andWhere('o.appliedPromotions != \'[]\'')
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.

Are we sure, this notation will be the same for postgres?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As we don't have a build for postgres, I am not 100% sure

@GSadee GSadee force-pushed the reapply-cp-after-rule-change branch from f2fedce to c34c503 Compare September 28, 2021 06:53
@GSadee GSadee changed the title [API][CatalogPromotions] reapply catalog promotions on rule update [API][CatalogPromotions] Reapplying catalog promotions on rule update Sep 28, 2021
@GSadee GSadee changed the title [API][CatalogPromotions] Reapplying catalog promotions on rule update [API][CatalogPromotion] Reapplying catalog promotions on rule update Sep 28, 2021
@GSadee GSadee force-pushed the reapply-cp-after-rule-change branch from c34c503 to effb8eb Compare September 29, 2021 05:39
@GSadee GSadee force-pushed the reapply-cp-after-rule-change branch from a261860 to 7194095 Compare September 29, 2021 08:00
And the visitor should see that the "PHP Mug" variant is discounted from "$5.00" to "$2.50" with "Mug sale" promotion

@api
Scenario: Reapplying catalog promotion after adding another action
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
Scenario: Reapplying catalog promotion after adding another action
Scenario: Reapplying catalog promotion after adding another rule

@AdamKasp AdamKasp merged commit 18135d7 into Sylius:master Sep 29, 2021
@AdamKasp
Copy link
Copy Markdown
Contributor

AdamKasp commented Sep 29, 2021

Thank you, Dominik and Grzegorz 🎉

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants