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

Reorder uses prices exluding tax for customer entered prices regardless of taxsettings #5826

Open
AndreiMaz opened this issue Sep 17, 2021 · 3 comments

Comments

@AndreiMaz
Copy link
Member

nopCommerce version: 4.40.3

Steps to reproduce the problem:

have a problem with my shopping cart total decreasing every time i do reorder on an order including products with CustomEredenteredPrice options enabled. It only happens when PricesIncludeTax is enabled in taxsettings.

Found out that the ReOrderAsync function in the OrderProcessingService is always using
orderItem.UnitPriceExclTax regardless of taxsettings.

Original code:

await _shoppingCartService.AddToCartAsync(customer, product,
                    ShoppingCartType.ShoppingCart, order.StoreId,
                    orderItem.AttributesXml, orderItem.UnitPriceExclTax,
                    orderItem.RentalStartDateUtc, orderItem.RentalEndDateUtc,
                    orderItem.Quantity, false);

Fix:

await _shoppingCartService.AddToCartAsync(customer, product,
                    ShoppingCartType.ShoppingCart, order.StoreId,
                    orderItem.AttributesXml, _taxSettings.PricesIncludeTax ?
                    orderItem.UnitPriceInclTax : orderItem.UnitPriceExclTax,
                    orderItem.RentalStartDateUtc, orderItem.RentalEndDateUtc,
                    orderItem.Quantity, false);

This way the customered entered price will be correct both for those who have the PricesIncludeTax option enabled or disabled :)

Source: https://www.nopcommerce.com/en/boards/topic/91910/reorder-uses-prices-exluding-tax-for-customer-entered-prices-regardless-of-taxsettings

@shadev256
Copy link

If this issue needs to be resolved, I will be happy to do it.

or if you could recommend another issue. So I could contribute something

@AndreiMaz @RomanovM

@AndreiMaz
Copy link
Member Author

@UsamaShahid69 Sure. Please make a pull request

@shadev256
Copy link

I have made the PR for this. You can review it.

PR link: #6398

@AndreiMaz @RomanovM

@AndreiMaz AndreiMaz modified the milestones: Version 4.60, Version 4.70 Nov 18, 2022
@AndreiMaz AndreiMaz removed this from the Version 4.70 milestone Jan 19, 2023
@RomanovM RomanovM added this to the Version 4.70 milestone Jan 23, 2023
@RomanovM RomanovM self-assigned this Jan 24, 2023
@AndreiMaz AndreiMaz modified the milestones: Version 4.70, Version 4.80 Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants