Magento Version: Magento 2.1.5
We are using table rate method for shipping, below are the value range:
- Rate $6.99 for orders up to $12.99
- Rate $5.99 for orders above $13 and up to $25.98
- Rate $4.99 for orders above $26 and up to $35.98
- Free shipping above $35 (using sales rule)
When the subtotal is $19.98, we have shipping rate as $5.99, that is correct. On applying a discount of $9, the amount will be reduced to $10.98 and now the shipping rate should be changed as $6.99(as $10.98 is below $12.99 - 1st rate) but still we could see the shipping rate as $5.99 (second rate).
We did some analysis and found, shipping amount is calculating before applying discount(subtotal) and not for the amount after applying discount(SubtotalWithDiscount).
Steps to reproduce
Add a few products to cart and make the subtotal to reach around $19. apply discount code 'TEST', this will give -$9.99 as discount amount
As per the table rate method for shipping provided above, As the subtotal is less than $10, the shipping amount should be $6.99
But the shipping amount calculated is $5.99 We did some analysis and found, shipping amount is calculating before applying discount(subtotal) and not for the amount after applying discount(SubtotalWithDiscount).
Is any other facing the same issue, if so please provide us the solution.