\Cairn_Shipping

Functions for doing shipping calculations.

Summary

Methods
Properties
Constants
init()
usps_intlratev2()
usps_ratev4()
$user_id
$zip_origin
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$user_id

$user_id

$zip_origin

$zip_origin

Methods

init()

init()

Callback to initialize the settings for the USPS Web Tools API.

usps_intlratev2()

usps_intlratev2(array $services, integer $pounds, integer $ounces, float $value, string $country, integer $width, integer $height, integer $length) : array

Retreives the international shipping estimate from the USPS Web Tools API

Parameters

array $services

The services ids (integers) to get retreive prices.

integer $pounds

The pounds of the package.

integer $ounces

The ounces of the package.

float $value

The valued price of the package contents.

string $country

The destination country.

integer $width

The width of the package.

integer $height

The height of the package.

integer $length

The length of the package.

Returns

array —
  • service_id integer The id of the service.
  • service string The name of the service.
  • rate float The estimate of the shipping.

usps_ratev4()

usps_ratev4(array $services, integer $pounds, integer $ounces, integer $zip, integer $width, integer $height, integer $length) : array

Retreives the domestic shipping estimate from the USPS Web Tools API

Parameters

array $services
  • name string The name of the service, such as 'Priority'.
  • title string The title to display the service, such as 'USPS Priority'.
integer $pounds

The pounds of the package.

integer $ounces

The ounces of the package.

integer $zip

The destination zip.

integer $width

The width of the package.

integer $height

The height of the package.

integer $length

The length of the package.

Returns

array —
  • service string The name of the service.
  • rate float The estimate of the shipping.