-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make price_selector return configurable
The current price_for method ignores its implied return value and serves up a Spree::Money object rather than a Spree::Price. The Spree::Price model is useful in its ability to be extended to support sales_prices, partial prices, etc. Having this method return a Spree::Money object is limiting, and the .money call is easy enough to be left up to the end user. This modifies the api of the #price_for method to optionally recieve a return_price flag. This allows us to deprecate the current behaviour and let users modify their code to call .money explicitly. If desired, this can be set to always return a Spree::Price globally via the Spree::Config.price_selector_returns_price flag.
- Loading branch information
Mike Conlin
committed
Feb 5, 2021
1 parent
73c2db3
commit 14fcc0e
Showing
2 changed files
with
88 additions
and
43 deletions.
There are no files selected for viewing
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
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