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

Feature rounding options configurable from admin. Related #677, #1424 #1983

Conversation

BrandonSpor
Copy link

Because RoundingHelper.RoundPrice handles all rounding, I would like to suggest adding the ability to configure some basic settings for how the rounding is handled.

The first option (RoundingPrecision) allows users to pass in the number of decimal places they would like to round to. Default would be 2. Right now there is no validation if a user enters a negative number. I could add it if suggested.

The second option (UseRoundingPrecisionForPriceDisplay) is would mostly be used by b2b implimentations where a buyer might want to see the entire price. In this case the same number of digits used for rounding would also be shown for the price on a product. It is disabled by default to use the standard 2 places.

The third option (RoundAwayFromZero ) just allows the admin to use this as a rounding options. While there has not been a lot of demand for this, it has come up.

Lastly, I am passing the Catalog Settings into the helper method so that the helper method does not have to resolve the settings. In most cases the settings were already loaded in the class where the helper method is being used.

By allowing these features out of the box, it would make it easy for plugin developers to handle these cases without modifying core code or over-riding many services, especially since all of this logic passes through the single line of code in the RoundingHelper.

@AndreiMaz
Copy link
Member

@BrandonSpor Thanks a lot! We'll definitely use it. In the meantime, could you also please answer my questions at http://www.nopcommerce.com/boards/t/41958/suggestion-ordertotal-rounding.aspx#176813

@RomanovM
Copy link
Contributor

Thanks for your contribution. We have already implemented it. See #1424

@RomanovM RomanovM closed this Oct 25, 2017
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