shopp_product_addon_set_donation()

set donation product type settings on an addon product variant.

shopp_product_addon_set_donation ( $addon, $settings )

@param int/Price $addon (required) The priceline id to set donation 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 array $settings (required) The array of settings (minimum => bool, variable => bool), to set price as minimum donation flag and variable donation amounts flag.
@return bool/Price false on failure, true if Price saved, else the modified Price object.

Description

set donation product type settings on an addon product variant.

This function uses shopp_product_variant_set_donation().

Example

// Product 2 has a donation addon product
$Addon = shopp_product_variant(array('product' => 2, 'option' => array('More Ways To Help' => 'Make a Donation')));

// set the donation settings on the Addon
// When 'variable' is true, the customer can enter their own donation value amount.
// When 'minimum' is true, the base donation amount is the minimum donation accepted.
shopp_product_addon_set_donation($Addon->id, array('variable'=>true, 'minimum'=>true));

See Also

You must be logged in to post a comment.

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

Skip to toolbar