shopp_product_publish()

publish a Shopp product.

shopp_product_publish ( $product, $flag, $datetime )

@param int (required) $product the product id to publish/unpublish
@param bool (optional default: false) $flag true for publish, false for unpublish
@param int (optional) $datetime a unix datetime, use php mktime() to create this
@return bool true on success, false on failure

Description

Sets a product to published state, now or in the future, or unpublish a product

Example

// unpublish product 107
shopp_product_publish( 107, false );

// publish product 107 immediately
shopp_product_publish( 107, true );

// publish product 107 on 2011-12-01 00:00:00
shopp_product_publish( 107, true, mktime(0, 0, 0, 12, 1, 2011) );

See Also

You must be logged in to post a comment.

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

Skip to toolbar