shopp_product_addon_set_subscription()

used to setup the subscription parameters on Addons of type Subscription.

shopp_product_addon_set_subscription ( $addon, $settings )

@param int/Price $addon (required) The priceline id to set donation settings on, or the Price object to change.  If Price object is specified, the object will be returned, but not saved to the database.
@param array $settings (required) The array of settings. Specify any trial period pricing, and the define the billing cycle.
@return bool/Price false on failure, true if Price saved, else the modified Price object.

Description

This function is used to setup the subscription parameters on Addons of type Subscription.

shopp_product_addon_set_subscription() uses .

Examples

// subscription settings array
$settings = array();

// setup the trial period and price (optional)
// here is a 15 day trial for $10.00
$settings['trial'] = array();
$settings['trial']['price'] = 10.00;

// setup the trial cycle
$settings['trial']['price']['cycle'] = array();
// 7 day trial
$settings['trial']['price']['cycle']['interval'] = 15;
$settings['trial']['price']['cycle']['period'] = 'd';

// the billing cycle is the normal recurring payment
// setup the billing cycle as follows
$settings['billcycle'] = array();
// 0 for infinite cycles, integer number for # of cycles to repeat
$settings['billcycle']['cycles'] = 0;
$settings['billcycle']['cycle'] = array();
// repeat the billing cycles ever 12 months
// d for days, w or weeks, m for months, and y for years
$settings['billcycle']['cycle']['interval'] = 12;
$settings['billcycle']['cycle']['period'] = 'm';

// my subscription addon id
$addon = 153;
shopp_product_addon_set_subscription ( $addon, $settings);

See Also

You must be logged in to post a comment.

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

Skip to toolbar