shopp_product_set_type()

sets the type of a product without product variants.

shopp_product_set_type ( $product, $type )

@param int $product (required) The Product id to set the type on.
@param string $type (optional default:N/A) The product price type, ex Shipped, Download, Virtual, Subscription.  N/A is a disabled priceline.
@return bool true on success, false on failure

Description

sets the type of a product without product variants.

Use instead if the product has variants.

Default Product Types
* Shipped – the product, product variant, or addon is shipped.
* Download – the product, product variant, or addon is a digital download.
* Virtual – the product, product variant, or addon is non-tangible.
* Subscription – the product, product variant, or addon is a type of subscription, with recurring payment.
* N/A – the product, product variant, or addon is disabled.

Example

// Adding a stub product
$data = array(
    'name' => "Music Album",
    'single' => array(),
    'publish' => array( 'flag' => true ),
    'description' =>
        "My Music Track"
);
$Product = shopp_add_product($data);

// set the product type to Download
shopp_product_set_type ( $Product->id, 'Download');

See Also

You must be logged in to post a comment.

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

Skip to toolbar