WTFreight Class
The class used to calculate Freight for Orders
Item Index
Methods
- getCanDeliver static
- getDomesticZone static
- getWeightRange static
- postcodeToState static
- registerFreightFunction static
Methods
getCanDeliver
(
Boolean
static
-
args
Return true if can deliver to the postcode in args
Parameters:
-
argsArrayPossible keys: "postcode"
Returns:
Boolean:
returns true if can deliver
getDomesticZone
(
Int
static
-
carrierGuid -
postcode
Get a carriers Australian zone for a postcode
Parameters:
-
carrierGuidIntThe guid of the carrier
-
postcodeStringThe postcode
Returns:
Int:
The id of the zone, or 0 if no zone found
getWeightRange
(
Int
static
-
weight
Get the id of the weight range a weight (in grams) belongs to
Parameters:
-
weightIntThe weight in grams
Returns:
Int:
The id of the weight range, or 0 if no range found
postcodeToState
(
String
static
-
postcode
Return the Australian state for a postcode
Parameters:
-
postcodeStringThe postcode to find
Returns:
String:
The state the postcode belongs to
registerFreightFunction
(
static
-
function
Register a custom function to calculate freight
Parameters:
-
functionFunctionThe custom function, which should return the cost of freight in dollars and cents
