Difference between revisions of "Nats get option details"
TMMMikeSopko (talk | contribs) (→Output) |
|||
(15 intermediate revisions by 5 users not shown) | |||
Line 3: | Line 3: | ||
}} | }} | ||
− | + | ''{nats_get_option_details}'' is a [[Smarty]] function that looks up details for a specified option-- this information will not be biller specific (duration, price, etc.) This function stores a list of the details for the given option in the ''{$option_details}'' Smarty variable. | |
− | |||
__TOC__ | __TOC__ | ||
Line 17: | Line 16: | ||
! Example | ! Example | ||
|- | |- | ||
− | | | + | | '''optionid''' |
| The ID of the option to get info for | | The ID of the option to get info for | ||
| Any valid optionid number | | Any valid optionid number | ||
| none | | none | ||
| optionid="123" | | optionid="123" | ||
+ | |- | ||
+ | | billerid | ||
+ | | The ID of the biller to get info for | ||
+ | | Any valid optionid number or ALL for all billers | ||
+ | | none | ||
+ | | billerid="1" | ||
+ | |- | ||
+ | | tourid | ||
+ | | The ID of the tour to get info for | ||
+ | | Any valid tourid, within the site | ||
+ | | Default Tour | ||
+ | | tourid="1" | ||
|} | |} | ||
== Output == | == Output == | ||
− | A list of option details for the given option in the <tt>{$option_details}</tt> Smarty variable. | + | A list of option details for the given option in the <tt>{$option_details}</tt> Smarty variable. It will contain the following information: |
+ | |||
+ | <pre> | ||
+ | optionid => "7" | ||
+ | siteid => "3" | ||
+ | networkid => "0" | ||
+ | deleted => "0" | ||
+ | enabled => "1" | ||
+ | orderid => "1" | ||
+ | option_type_id => "0" | ||
+ | billerid => "0" | ||
+ | programid => "0" | ||
+ | no_old_members => "1" | ||
+ | name => "3 Day Trial <b>test</b>" | ||
+ | rebill_days => "30" | ||
+ | rebill => "30.95" | ||
+ | initial_days => "3" | ||
+ | initial => ".25" | ||
+ | initial_free => "0" | ||
+ | hidden => "0" | ||
+ | package_upgrade_allowed => "0" | ||
+ | </pre> | ||
+ | |||
+ | When a billerid is passed into the template function, an additional index is added to <tt>{$option_details}</tt>. This is the biller index and will contain the information for the biller for the join option. An example of what <tt>{$option_details}</tt> will look like when a biller ID is passed into the function: | ||
+ | <pre> | ||
+ | optionid => "7" | ||
+ | siteid => "3" | ||
+ | networkid => "0" | ||
+ | deleted => "0" | ||
+ | enabled => "1" | ||
+ | orderid => "1" | ||
+ | option_type_id => "0" | ||
+ | billerid => "0" | ||
+ | programid => "0" | ||
+ | no_old_members => "1" | ||
+ | name => "3 Day Trial <b>test</b>" | ||
+ | rebill_days => "30" | ||
+ | rebill => "30.95" | ||
+ | initial_days => "3" | ||
+ | initial => ".25" | ||
+ | initial_free => "0" | ||
+ | hidden => "0" | ||
+ | package_upgrade_allowed => "0" | ||
+ | biller => Array (1) | ||
+ | 4 => Array (2) | ||
+ | biller_optioninfo_pi_code => "1" | ||
+ | biller_optioninfo_list => "1" | ||
+ | </pre> | ||
== Notes == | == Notes == | ||
− | + | As of [[NATS]] version 4.0.73.1, you can now pass ''billerid=1'' OR ''billerid=ALL'' to the nats_get_option_details() function. This allows you to get option details for one specific biller, or biller details for ALL billers available for that option. | |
+ | |||
+ | == Example Code == | ||
+ | |||
+ | You need at least pass an optionid, for example: | ||
+ | {nats_get_option_details optionid=$key} | ||
+ | |||
+ | Or, pass an optionid and billerid. This will return the full details of option with ID 1 to the array ''{$option_details}'': | ||
+ | {nats_get_option_details optionid=1 billerid='ALL'} | ||
+ | |||
+ | |||
+ | [[Category:NATS4 Template Functions]] |
Latest revision as of 09:01, 17 September 2013
{nats_get_option_details} is a Smarty function that looks up details for a specified option-- this information will not be biller specific (duration, price, etc.) This function stores a list of the details for the given option in the {$option_details} Smarty variable.
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
optionid | The ID of the option to get info for | Any valid optionid number | none | optionid="123" |
billerid | The ID of the biller to get info for | Any valid optionid number or ALL for all billers | none | billerid="1" |
tourid | The ID of the tour to get info for | Any valid tourid, within the site | Default Tour | tourid="1" |
Output
A list of option details for the given option in the {$option_details} Smarty variable. It will contain the following information:
optionid => "7" siteid => "3" networkid => "0" deleted => "0" enabled => "1" orderid => "1" option_type_id => "0" billerid => "0" programid => "0" no_old_members => "1" name => "3 Day Trial <b>test</b>" rebill_days => "30" rebill => "30.95" initial_days => "3" initial => ".25" initial_free => "0" hidden => "0" package_upgrade_allowed => "0"
When a billerid is passed into the template function, an additional index is added to {$option_details}. This is the biller index and will contain the information for the biller for the join option. An example of what {$option_details} will look like when a biller ID is passed into the function:
optionid => "7" siteid => "3" networkid => "0" deleted => "0" enabled => "1" orderid => "1" option_type_id => "0" billerid => "0" programid => "0" no_old_members => "1" name => "3 Day Trial <b>test</b>" rebill_days => "30" rebill => "30.95" initial_days => "3" initial => ".25" initial_free => "0" hidden => "0" package_upgrade_allowed => "0" biller => Array (1) 4 => Array (2) biller_optioninfo_pi_code => "1" biller_optioninfo_list => "1"
Notes
As of NATS version 4.0.73.1, you can now pass billerid=1 OR billerid=ALL to the nats_get_option_details() function. This allows you to get option details for one specific biller, or biller details for ALL billers available for that option.
Example Code
You need at least pass an optionid, for example:
{nats_get_option_details optionid=$key}
Or, pass an optionid and billerid. This will return the full details of option with ID 1 to the array {$option_details}:
{nats_get_option_details optionid=1 billerid='ALL'}