shopp_packager_type

filters the packaging behavior type setting that the packager class will use to model the packaging of the cart items when sending data to online shipping estimate modules.

add_filter( 'shopp_packager_type', [callback] )

@param string $type the packaging behavior type setting that the packager class will use to modle the packaging of the cart items when sending data to online shipping estimate modules.

Description

filters the packaging behavior type setting that the packager class will use to model the packaging of the cart items when sending data to online shipping estimate modules.

In Shopp 1.2, these packaging behavior types are:
* mass – All items in the cart will be added to the same package, and only the weights will be summed.
* all – All items in the cart will be added to the same package, and the dimensions of the final package will be attempted by max width and max length and total height.
* like – Only multiple quantity of the same item will be placed in one package together. 2 of Item A and 2 of Item B will result in 2 packages.
* piece – Each item in the cart, including multiple quantities, will be separated into individual packages.

You could also specify a custom value, but then you must also write custom packaging routines to handle your custom value.

Example

// register filter callback
add_filter('shopp_packager_type', 'shopp_packager_type_fltr');

// create filter function
function shopp_packager_type_fltr( $type ) {
    // force the packager to always use the "All Together by Weight"
    // packaging strategy
    return 'mass';
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar