-
Notifications
You must be signed in to change notification settings - Fork 6
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
Goodies! #75
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/models/solidus_friendly_promotions/friendly_promotion_discounter.rb
Outdated
Show resolved
Hide resolved
app/models/solidus_friendly_promotions/actions/create_discounted_item.rb
Outdated
Show resolved
Hide resolved
mamhoff
force-pushed
the
goodies
branch
2 times, most recently
from
November 6, 2023 20:33
cbdc01e
to
28bd6f7
Compare
tvdeyen
reviewed
Nov 7, 2023
app/decorators/models/solidus_friendly_promotions/line_item_decorator.rb
Outdated
Show resolved
Hide resolved
app/models/solidus_friendly_promotions/actions/create_discounted_item.rb
Outdated
Show resolved
Hide resolved
app/models/solidus_friendly_promotions/actions/create_discounted_item.rb
Outdated
Show resolved
Hide resolved
app/decorators/models/solidus_friendly_promotions/order_decorator.rb
Outdated
Show resolved
Hide resolved
We want to have an action that creates a new discounted line item. Its discount should never be affected by promotions in previous lanes.
We want to be able to add a line item associated to a promotion actions (to see who created it).
mamhoff
force-pushed
the
goodies
branch
2 times, most recently
from
November 7, 2023 13:57
b2a5348
to
86e5ec8
Compare
This also introduced the `SolidusFriendlyPromotion::Actions::Automation` module that indicates this action is an automation. It's only available at the order level.
Solidus offers line item comparison hooks, and we'll make use of them.
This is not done automatically in Solidus, so we have to do it here.
Automatic items are probably already 100% discounted, and it's really hard to make their discounts play well with others.
tvdeyen
approved these changes
Nov 7, 2023
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.
A great feature, very well implemented!
app/decorators/models/solidus_friendly_promotions/line_item_decorator.rb
Show resolved
Hide resolved
Closed
mamhoff
added a commit
that referenced
this pull request
Jul 1, 2024
mamhoff
added a commit
that referenced
this pull request
Oct 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements an API and a proof-of-concept automation: Adding a "goodie", a discounted line item.
The promotion action API for this is very close to Solidus', reflecting that this is very close to the behavior of probably many custom promotion actions.
Goodies are a bit special: They are supposed to never be affected by other promotions (most of the time they will be actually free).