shopp_product_addon_set_saleprice()

set the sale pricetag on an addon.

shopp_product_addon_set_saleprice ($addon, $flag, $price)

@param int/Price $addon (required) The priceline id to set the sale price 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 sale flag on the addon.  If false, price is ignored.
@param float $price the price to be set
@return bool/Price false on failure, true if Price saved, else the modified Price object.

Description

Set the sale pricetag on an addon.

Example

// Get the variant Price object for product with variants
// Services: Gift-wrapping
$Price = shopp_product_variant( array('product' => 12, 
    'option'=>array('Services'=>'Gift-wrapping')), 'addon' );

// Set the sale addon pricetag to $0.50
shopp_product_addon_set_saleprice( $Price->id, 0.50 );

// Disable the sale price on an addon, id 100
shopp_product_addon_set_saleprice( 100, false );

See Also

You must be logged in to post a comment.

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

Skip to toolbar