-
Notifications
You must be signed in to change notification settings - Fork 1
How Quotes Are Calculated
The math of how the module computes the final price of a particular shipping method from USPS can be expressed in the following function:
(Sorry for the math flashbacks)
Where the variables are:
-
$M$ be the Method in question.
$M_{Quote}$ : represents the quoted price of the method.
$M_{Handling}$ : represents the handling surcharge of THAT particular method.
$M_{Services}$ : represents the charges for any service attached to that method (Certified Mail, Sunday delivery, etc.) -
$N_{Boxes}$ represents the number of boxes of an order (as determined by ZenCart) -
$O_{Handling}$ represents the handling fee as configured overall. -
$(N_{Boxes} | 1)$ represents either the number of boxes or 1 (for the whole order). This is represented by the prompt forHandling Per Order or Per Box.
For example, let's make a quote for a 2 "box" order with a calculated rate for USPS Ground Advantage being $8.00. Because ZenCart calculated two boxes, we multiply all the calculations for this method by two.

Overall Handling Fee set to $3 Domestic, $0 International and being applied on a per order basis. (This option will likely be renamed to surcharge in a future update.)

Focusing on Ground Advantage for this, it has a $2.00 handling surcharge for that method.

We'll say that Certified Mail has a Surcharge of $4 for this example.
Let's plug it into the formula:
$31.00 will be the final cost of the quote for this Ground Advantage quote.
That's generally how this module calculates the quotes. In short, each module can have a surcharge applied on it and/or you can apply a superceding surcharge on the whole order or each box of the order. Be careful with the setting of the surcharges/handling charges. As it can detract you from customers.