shopp_product_addon_set_shipping()

turn on/off shipping charges on a addon and set shipping settings (weight and dimensions)

shopp_product_addon_set_shipping ( $addon, $flag, $settings )

@param int/Price $addon (required) The priceline id to turn setup the shipping settings on, or the Price object to change.  If Price object is specified, the object will be returned, but not saved to the database.
@param bool $flag (optional default:false) true for on, false for off. Turns on or off the shipping charges on the addon.  If false, settings are ignored.
@param array $settings array of shipping dimensions (weight => float, height => float, length => float, width => float)
@return bool/Price false on failure, true if Price saved, else the modified Price object.

Description

turn on/off shipping charges on a addon and set shipping settings (weight and dimensions)

This function uses shopp_product_variant_set_shipping().

Example

// Get the shipped addon of product 22
$ShippedAddon = shopp_product_variant(
    array('product'=>22,'option' =>
        array(
            'Addon Menu'=>'My Shipped Addon'
            )
        )
    );

// create setting array
// units are setup in your shipping settings in the Admin
$ship_settings = array(
    'weight' => 20.1, 
    'width' => 15,
    'length' => 25,
    'height' => 10
);

// enable shipping costs and set weight/dimensions
shopp_product_addon_set_shipping($ShippedAddon->id, true, $ship_settings);

See Also

You must be logged in to post a comment.

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

Skip to toolbar