Function __global->add_usergroup_subscription

Definitions

sources/ecommerce2.php

  • Add a usergroup subscription.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$title SHORT_TEXT No No required parameter N/A N/A The title
$description LONG_TEXT No No required parameter N/A N/A The description
$price REAL No No required parameter N/A N/A The price
$tax_code ID_TEXT No No required parameter N/A N/A The tax code
$length integer No No required parameter N/A N/A The length
$length_units SHORT_TEXT No No required parameter y m d w N/A The units for the length
$auto_recur BINARY No No required parameter N/A N/A Auto-recur
$group_id GROUP No No required parameter N/A N/A The usergroup that purchasing gains membership to
$uses_primary BINARY No No required parameter N/A N/A Whether this is applied to primary usergroup membership
$enabled BINARY No No required parameter N/A N/A Whether this is currently enabled
$mail_start ?LONG_TEXT No No required parameter N/A N/A The text of the e-mail to send out when a subscription is start (null: default)
$mail_end ?LONG_TEXT No No required parameter N/A N/A The text of the e-mail to send out when a subscription is ended (null: default)
$mail_uhoh ?LONG_TEXT No No required parameter N/A N/A The text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (null: default)
$mails array No No [] N/A N/A Other e-mails to send

Returns

  • The ID
  • Type: AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add a usergroup subscription.
 *
 * @param  SHORT_TEXT $title The title
 * @param  LONG_TEXT $description The description
 * @param  REAL $price The price
 * @param  ID_TEXT $tax_code The tax code
 * @param  integer $length The length
 * @param  SHORT_TEXT $length_units The units for the length
 * @set y m d w
 * @param  BINARY $auto_recur Auto-recur
 * @param  GROUP $group_id The usergroup that purchasing gains membership to
 * @param  BINARY $uses_primary Whether this is applied to primary usergroup membership
 * @param  BINARY $enabled Whether this is currently enabled
 * @param  ?LONG_TEXT $mail_start The text of the e-mail to send out when a subscription is start (null: default)
 * @param  ?LONG_TEXT $mail_end The text of the e-mail to send out when a subscription is ended (null: default)
 * @param  ?LONG_TEXT $mail_uhoh The text of the e-mail to send out when a subscription cannot be renewed because the subproduct is gone (null: default)
 * @param  array $mails Other e-mails to send
 * @return AUTO_LINK The ID
 */

function add_usergroup_subscription(string $title, string $description, float $price, string $tax_code, int $length, string $length_units, int $auto_recur, int $group_id, int $uses_primary, int $enabled, ?string $mail_start, ?string $mail_end, ?string $mail_uhoh, array $mails = []) : int