API Docs for: WebTemplate API v2.0
Show:

WTFreight Class

The class used to calculate Freight for Orders

Item Index

Methods

getCanDeliver

(
  • args
)
Boolean static

Return true if can deliver to the postcode in args

Parameters:

  • args Array

    Possible keys: "postcode"

Returns:

Boolean: returns true if can deliver

getDomesticZone

(
  • carrierGuid
  • postcode
)
Int static

Get a carriers Australian zone for a postcode

Parameters:

  • carrierGuid Int

    The guid of the carrier

  • postcode String

    The postcode

Returns:

Int: The id of the zone, or 0 if no zone found

getWeightRange

(
  • weight
)
Int static

Get the id of the weight range a weight (in grams) belongs to

Parameters:

  • weight Int

    The weight in grams

Returns:

Int: The id of the weight range, or 0 if no range found

postcodeToState

(
  • postcode
)
String static

Return the Australian state for a postcode

Parameters:

  • postcode String

    The postcode to find

Returns:

String: The state the postcode belongs to

registerFreightFunction

(
  • function
)
static

Register a custom function to calculate freight

Parameters:

  • function Function

    The custom function, which should return the cost of freight in dollars and cents