nopCommerce
nopCommerce copied to clipboard
Reorder uses prices exluding tax for customer entered prices regardless of taxsettings
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
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
@UsamaShahid69 Sure. Please make a pull request
I have made the PR for this. You can review it.
PR link: https://github.com/nopSolutions/nopCommerce/pull/6398
@AndreiMaz @RomanovM