Working with:
- no-source nopCommerce 4.50.1
- NOP Templates Venture theme
- restaurant ordering
Website conditions:
- All food items are taxable at 5%
- There is a dropdown list Checkout Attribute to add a tip with non-taxable Price Adjustments
- A 3% Payment Method Additional Fee (Processing Fee) is charged on the total, also taxable at 5%
- Site uses one-page Checkout
EXPECTED BEHAVIOR
Expected Tax and Processing Fees under Checkout Payment Method and Confirm Order sections are as follows;
Let:
OT = Order Total (taxable)
T = Tip (non-taxable)
ST = Sub-Total
TX = Tax
p = Tax Rate
PF = Processing Fee
q = Processing Fee rate
Then:
(1) TX = p x (OT + PF)
(2) PF = q x (OT + T + TX)
Substituting (2) in (1) and solving for TX gives:
(3) TX = p[(1+q)OT + qT]
(4) PF = q(ST + TX)
ACTUAL BEHAVIOR
- Amount on Checkout | Payment Method is incorrect
- Amount under Checkout | Confirm Order differs from Payment Method section and is closer but sometimes incorrect
STEPS TO REPRODUCE
- Added one item to Cart at 12.49
- Went to Cart page
- Added a 2.00 tip
- Sub-total of 14.49
Per formulas above, tax should be 0.65 and processing fee should be 0.45:
With the numbers from the example:
TX = 5% x [(1+3%) x 12.49 + 3% x 2.00] = 0.65
PF = 3% x (14.49 + 0.65) = 0.45
- Agreed with the Terms of Service
- Clicked Checkout button, going to Bill Address section
- Clicked Continue button in Billing Address section, going to Payment Method section
CHECKOUT/PAYMENT METHOD shows:
Order Total: 12.49
Tip: 2.00
Sub-Total: 14.49
3% Processing Fee: 0.45
Tax: 0.62 ***** INCORRECT - corresponds to tax without the 3% Processing Fee
Total: 15.56
- Added a credit card
- Clicked Continue button on Payment Information section, going to Confirm Order section
CHECKOUT/CONFIRM ORDER shows:
3% Processing Fee: 0.45
Tax: 0.64 ***** INCORRECT
Total: 15.58
Notes:
- Might relate to: https://github.com/nopSolutions/nopCommerce/issues/4936