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

Fix bug related to free shipping not being applied correctly #3671

Merged

Conversation

jacquesporveau
Copy link
Contributor

Description

Fixes #3664

I would leave a more detailed PR description but the author of #3664 did a really good job in describing the problem at hand and this PR is just a solution for that.

I kind of took a bit of liberty in improving the spec quality. Let me know if you don't like that style or something like that and I can rework it if need be.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

Contexts usually refer to when something changes in the test environment
that effects the outcome of the test. I don't think we should have been
using context here and describe is a more common pattern imo.
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

Thanks @jacquesporveau 🎉
I left 2 small comments on the spec context descriptions, but in general this looks good to me 👍

Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

One suggestion, but I think this looks good.

core/app/models/spree/promotion/actions/free_shipping.rb Outdated Show resolved Hide resolved
In cases that an order contained *some* shipments with free shipping
applied already then when this method would run again it was possible to
get an early return and not correctly apply free shipping.
@jacquesporveau jacquesporveau force-pushed the jacquesporveau/free-promo-bug branch from 08c47bf to caf8957 Compare June 19, 2020 18:24
@jacquesporveau
Copy link
Contributor Author

Thanks gang. I've addressed the feedback.

Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

Great, nice fix!

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thank you, works for me.

@kennyadsl kennyadsl merged commit a3160d8 into solidusio:master Jun 22, 2020
@jacquesporveau jacquesporveau deleted the jacquesporveau/free-promo-bug branch June 22, 2020 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FreeShipping promotion action doesn't work with multiple shipments
4 participants