-
-
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
#9858 Fix for promotion of 100 percent with coupon #9919
#9858 Fix for promotion of 100 percent with coupon #9919
Conversation
laurent35240
commented
Nov 12, 2018
Q | A |
---|---|
Branch? | 1.2 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | fixes #9858 |
License | MIT |
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.
Looks good! 💪
Glad you've written a good scenario. I'm only wondering if maybe we should have a scenario for an order with some shipping cost, to see what happens :)
@Zales0123 In fact the origin of the problem is the PercentType field in Symfony that will save a float for any value different than 100 and an int for 100. If I save value 99% I got this in configuration field of table sylius_promotion_action I think the BDD test does not see it because it bypass the Symfony form by creating directly promotion action with a percentage set to 1 as a float. If needed we can chat about a different/better way to fix this issue on slack |
I found a different way to fix this issue cf laurent35240@5ba1a2d |
I've just checked that and it seems to work 💪 Could you please push the changes here so we could iterate over it and, hopefully, merge it? :) |
It fixes the way data is saved in database after setting promotion action
Done |
@laurent35240 the build failed, could you, please, take a look at it? |
Sure, I will try to take a look at it this evening |
@Zales0123 Build fixed ;-) |
src/Sylius/Bundle/PromotionBundle/Form/Type/Action/PercentFloatType.php
Outdated
Show resolved
Hide resolved
...ius/Bundle/PromotionBundle/Form/DataTransformer/PercentFloatToLocalizedStringTransformer.php
Show resolved
Hide resolved
...ius/Bundle/PromotionBundle/Form/DataTransformer/PercentFloatToLocalizedStringTransformer.php
Outdated
Show resolved
Hide resolved
...ius/Bundle/PromotionBundle/Form/DataTransformer/PercentFloatToLocalizedStringTransformer.php
Show resolved
Hide resolved
...ius/Bundle/PromotionBundle/Form/DataTransformer/PercentFloatToLocalizedStringTransformer.php
Show resolved
Hide resolved
88943fc
to
4ef4380
Compare
…ilding the form for promotion
HI @Zales0123 Do you want other corrections on this PR? |
Thanks, Laurent! 🥇 |
…pon (laurent35240) This PR was merged into the 1.2 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes Sylius#9858 | License | MIT Commits ------- c46e7b1 Sylius#9858 Fix for promotion of 100 percent with coupon 9280859 Sylius#9858 Another fix for promotion of 100 percent with coupon 4ef4380 PHPDoc added about transformation c2af9ea Sylius#9858 Directly change view transformer to percent float when building the form for promotion
…pon (laurent35240) This PR was merged into the 1.2 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes Sylius#9858 | License | MIT Commits ------- c46e7b1 Sylius#9858 Fix for promotion of 100 percent with coupon 9280859 Sylius#9858 Another fix for promotion of 100 percent with coupon 4ef4380 PHPDoc added about transformation c2af9ea Sylius#9858 Directly change view transformer to percent float when building the form for promotion