shopp_product_variant_set_donation()

sets the minimum donation flag and the variable donation settings on a product, variant, or addon of type Donation.

function shopp_product_variant_set_donation ( $variant = false, $settings = array(), $context = 'variant' )

@param int/Price $variant (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.
@param string $context (optional default:variant) enforces the priceline is a 'product','variant', or 'addon'
@return bool/Price false on failure, true if Price saved, else the modified Price object.

Description

sets the minimum donation flag and the variable donation settings on a product, variant, or addon of type 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
$settings = array(
    'minimum' => true, // when true the base donation amount is the minimum donation accepted.
    'variable' => true // when true the customer can enter their own donation value amount.
);

shopp_product_variant_set_donation ( $Addon->id, $settings, 'addon' )

See Also

You must be logged in to post a comment.

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

Skip to toolbar