shipping_package

Enables calculation of compact order dimensions and total order weight with packaging to be passed on to shipping plugins.

Shop-Script

Input (passed by reference)

$items array Order items.
… your plugin code …

Output

$return['total_height']

Array with keys 'total_height', 'total_width', 'total_length', and 'total_weight' corresponding to calculated order dimensions and total order weight including the packaging weight. Instead of these values, a plugin may return only one value of type 'callable' with 'callback' key so that the execution of its code returns an array with keys 'total_height', 'total_width', 'total_length', and 'total_weight'.

$return['total_width']
$return['total_length']
$return['total_weight']
$return['callback']
Shop-Script

Plugin code example

PHP

public function shippingPackage($items)
{
    //return callback method name instead of an array of values
    return array('shopMyPluginHelper', 'shippingPackage');
}