1. Home
  2. Cash on Delivery Fee
  3. How the Fee Is Calculated

How the Fee Is Calculated

The extension automatically calculates COD fee using the following logic:

  1. Customer selects COD during checkout.
  2. Subtotal is fetched using cart->getSubTotal().
  3. System checks:
    • whether minimum amount is satisfied
    • whether maximum amount is satisfied
  4. If conditions match, the COD fee is added to:
    • $totals[]
    • $total

If any condition fails, the fee is not added.