class ShippingManifest implements ShippingManifestInterface (View source)

Properties

$options

The collection of available shipping options.

$getOptionUsing

Methods

__construct()

Initiate the class.

addOption(ShippingOption $option)

Add a shipping option to the manifest.

addOptions(Collection $options)

Add a collection of shipping options to the manifest.

clearOptions()

Remove all shipping options

getOptionUsing(Closure $closure)

Define closure to retrieve shipping option

Collection
getOptions(Cart $cart)

Return available options for a given cart.

ShippingOption|null
getOption(Cart $cart, string $identifier)

Return available option for a given cart by identifier.

ShippingOption|null
getShippingOption(Cart $cart)

Retrieve shipping option for a given cart

Details

__construct()

Initiate the class.

ShippingManifestInterface addOption(ShippingOption $option)

Add a shipping option to the manifest.

Parameters

ShippingOption $option

Return Value

ShippingManifestInterface

ShippingManifestInterface addOptions(Collection $options)

Add a collection of shipping options to the manifest.

Parameters

Collection $options

Return Value

ShippingManifestInterface

ShippingManifestInterface clearOptions()

Remove all shipping options

ShippingManifestInterface getOptionUsing(Closure $closure)

Define closure to retrieve shipping option

Parameters

Closure $closure

Return Value

ShippingManifestInterface

Collection getOptions(Cart $cart)

Return available options for a given cart.

Parameters

Cart $cart

Return Value

Collection

ShippingOption|null getOption(Cart $cart, string $identifier)

Return available option for a given cart by identifier.

Parameters

Cart $cart
string $identifier

Return Value

ShippingOption|null

ShippingOption|null getShippingOption(Cart $cart)

Retrieve shipping option for a given cart

Parameters

Cart $cart

Return Value

ShippingOption|null