Allow to recalculate cart prices#6399
Conversation
Allows a line item to recalculate its price. When prices change, that's a useful thing to have.
From version 5, we should recalculate cart prices when updating orders.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6399 +/- ##
=======================================
Coverage 89.48% 89.48%
=======================================
Files 980 980
Lines 20438 20446 +8
=======================================
+ Hits 18289 18297 +8
Misses 2149 2149 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This enhances the order updater to recalculate cart prices if preferred.
f2eda6b to
b3b5e56
Compare
jarednorman
left a comment
There was a problem hiding this comment.
Looks good.
@forkata Can you verify if this impacts the in-memory order updater.
@jarednorman Since this is all new code, we can rebase over this change and incorporate it in our work! |
|
Love this configuration and functionality @mamhoff! One thing I've been thinking about is if it makes sense to introduce some kind of return value object from the recalculate method. I don't have a good solution for that and I don't think it should be part of this change, but I am thinking of the use case where we want to communicate a price change when advancing from cart to checkout for example, through a flash etc. |
|
In our app, we do that already. But yeah, that's certainly worth exploring. Would you mind opening an issue or a discussion so we can collect the things that we might want to communicate? |
This was introduced upstream in solidusio#6399 and we want to preserve this functionality in the in-memory updater we're introducing as well. Co-authored-by: Martin Meyerhoff <mamhoff@gmail.com> Co-authored-by: Alistair Norman <alistair@super.gd>
This was introduced upstream in solidusio#6399 and we want to preserve this functionality in the in-memory updater we're introducing as well. Co-authored-by: Martin Meyerhoff <mamhoff@gmail.com> Co-authored-by: Alistair Norman <alistair@super.gd>
Summary
This adds a preference that allows implementers to choose to have the order updater recalculate cart prices.
Fixes #6206
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: