Add item totals, tax and shipping to get the final order cost.
Checkout arithmetic follows a fixed order, and the order changes the answer. The discount comes off the subtotal first, tax is calculated on the discounted amount rather than the original, and the free-shipping threshold is tested against the discounted subtotal — which is why a 10 percent code can push an order back below the threshold and reintroduce a shipping charge larger than the discount saved. The shortfall line tells you how much more to add if the threshold is worth chasing.
Order sequence
Discounted subtotal = subtotal x (1 - discount); tax = discounted subtotal x tax rate
Shipping test
Shipping is waived when the discounted subtotal reaches the free-shipping threshold
Only if you want the item. Spending 5 more to save 6.99 is sound; spending 20 on filler to save 6.99 is not, and the shortfall figure is there to make that comparison explicit.
It depends on the jurisdiction — some tax delivery charges, some do not. This calculation taxes goods only, which is the more common treatment; add the shipping into the subtotal if your jurisdiction taxes it.