shopp_product_set_saleprice()

set the sale pricetag on a single product.

shopp_product_set_saleprice ( $product, $flag, $price )

@param int $product (required) The Product id to set the sale price on.
@param bool $flag (optional default:false) true for on, false for off. Turns on or off the sale flag on the product.  If false, price is ignored.
@param float $price the price to be set
@return bool true on success, false on failure

Description

Set the sale pricetag on a single product. Use shopp_product_variant_set_saleprice() for products with variants.

Example

// Enable saleprice on product 15 and set the price to $12.55
shopp_product_set_saleprice ( 15, true, 12.55 )

// Disable sale on product 16
shopp_product_set_saleprice ( 16, 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