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

Goodies! #75

Merged
merged 9 commits into from
Nov 7, 2023
Merged

Goodies! #75

merged 9 commits into from
Nov 7, 2023

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Nov 4, 2023

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).

@mamhoff mamhoff force-pushed the goodies branch 2 times, most recently from cbdc01e to 28bd6f7 Compare November 6, 2023 20:33
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 mamhoff force-pushed the goodies branch 2 times, most recently from b2a5348 to 86e5ec8 Compare November 7, 2023 13:57
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.
Copy link
Collaborator

@tvdeyen tvdeyen left a 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!

@mamhoff mamhoff merged commit 9299eac into main Nov 7, 2023
4 checks passed
@mamhoff mamhoff deleted the goodies branch November 7, 2023 16:28
@mamhoff mamhoff mentioned this pull request Nov 7, 2023
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants