shopp_rmv_product_image()

remove a product image by image asset id

shopp_rmv_product_image ( $image )

@param int $image image id to remove from product.
@return bool false on failure, true on success.

Description

Remove a product image by image asset id.

Example

// Set the global Product context
ShoppProduct( shopp_product( 'My Product', 'name') );

// Remove all images for product "My Product"
if ( shopp('product', 'has-images') ) {
    while ( shopp('product', 'images') ) {
        $image_id = shopp('product', 'get-image', 'property=id');
        shopp_rmv_product_image($image_id);
    }
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar