Round Tax in 2.2 to 0.05

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Good day to you all

In Switzerland the smalles currency is 0.05 CHF. So I need to round the taxes.

https://www.nopcommerce.com/boards/t/7439/round-tax.aspx applies I guess to pre 2.0 versions.

Where would I need to add the logic in 2.2. I have downloaded only the site, do I need to download the project as well. What happens when updating to 2.3 - do I have to remember to change that again?

Markus
12 years ago
marktold wrote:
https://www.nopcommerce.com/boards/t/7439/round-tax.aspx applies I guess to pre 2.0 versions.

You're right. They're for 1.X version. But you can apply these changes to 2.X version. The main difference here is that logic from Libraries\Nop.BusinessLogic\Tax\TaxManager.cs file (1.X) moved to \Libraries\Nop.Services\Orders\OrderTotalCalculationService.cs (2.X). Look at GetTaxTotal method

marktold wrote:
Where would I need to add the logic in 2.2. I have downloaded only the site, do I need to download the project as well.

Right, source code is required

marktold wrote:
What happens when updating to 2.3 - do I have to remember to change that again?

Right
12 years ago
Thanks for the feedback again.

I don't know of any other country that does not have cents or 1/100 in there currency so I guess a feature request for a small country like switzerland would be at postition 104'498'444 moving up slowly so 4.5 would have it.

I don't really like to change the core because I would have to remember all changes on updates and that a big risk of getting errors later on.

Thanks again

Markus
12 years ago
Dear Andrei

I deceided that I need to have the rounding. So I downloaded the source code and extracted it to some folder (other then my web download of the current store)

I also downloaded MVC 3 since VS2010 complained.

-------

Is it correct that I simply can make the changes and rebuild my project?

What files/dll would I need to copy to my web/bin folder afterwards?


Markus
12 years ago
Dear Andrei

This is what I did. Would be glad if you could confirm this to be reasonable.

1) unzipd project with source
2) opened project in VS 2010
3) made the following change in libraries/nop.services/orders/OrderTotalCalculationServices.cs
Changed line 264
from
taxValue = Math.Round(taxValue, 2);
to
taxValue = Math.Round(taxValue * 20, 0) / 20;
4) build solution
5) ran the prepare.bat
6) ran the deploy.bat
7) uploaded the Deploayble/nop_2.20/bin/Nop.Services.dll

Does that make sense?

First time using nopCommerce MVC and stuff.

Markus
12 years ago
Looks fine.
10 years ago
Dear Andrei

Starting with an 3.1 project still needing to round to 0.05.

Is my previous post still right, or do I need to go about it in another way since I assume 3.1 has major changes over 2.x

Markus
9 years ago
a.m. wrote:
Looks fine.


Hello
I need to remove the 2 zeros from the Product list, but some of the money that is being used, remove the 2 zero applied only to one of them.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.