Skip to content

Conversation

@mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Dec 23, 2025

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:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

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.
@mamhoff mamhoff requested a review from a team as a code owner December 23, 2025 09:54
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Dec 23, 2025
@mamhoff mamhoff changed the title Recalculate line item prices Recalculate cart prices Dec 23, 2025
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.48%. Comparing base (f8779d6) to head (b3b5e56).
⚠️ Report is 4 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This enhances the order updater to recalculate cart prices if preferred.
Copy link
Member

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

Long overdue! Thanks

@tvdeyen tvdeyen added this to the 4.7 milestone Dec 23, 2025
@tvdeyen tvdeyen changed the title Recalculate cart prices Allow to recalculate cart prices Dec 23, 2025
@tvdeyen tvdeyen moved this to In Progress in Solidus Public Roadmap Dec 23, 2025
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.

Looks good.

@forkata Can you verify if this impacts the in-memory order updater.

@forkata
Copy link
Contributor

forkata commented Jan 5, 2026

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!

@forkata
Copy link
Contributor

forkata commented Jan 5, 2026

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.

@mamhoff
Copy link
Contributor Author

mamhoff commented Jan 6, 2026

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?

@mamhoff mamhoff merged commit 5bc7c00 into solidusio:main Jan 6, 2026
39 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Solidus Public Roadmap Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

Development

Successfully merging this pull request may close these issues.

Cart doesn't always recalculate when the underlying data changes

4 participants