Difference between revisions of "Nats get option details"

From TMM Wiki
Jump to navigationJump to search
 
(15 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
}}
 
}}
  
= nats_get_option_details =
+
''{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.
Stores a list of the details for the given option in the <tt>{$option_details}</tt> Smarty variable.
 
  
 
__TOC__
 
__TOC__
Line 17: Line 16:
 
! Example
 
! Example
 
|-
 
|-
| site
+
| '''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 &lt;b&gt;test&lt;/b&gt;"
 +
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 &lt;b&gt;test&lt;/b&gt;"
 +
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 ==
None.
+
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 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers
    Template Functions
nats_add_to_array
nats_adtool_replace_linkcode
nats_array_flip
nats_array_to_xml
nats_build_array_by_reference
nats_convert_bytes
nats_decode
nats_display_account_campaigns
nats_display_account_change_history
nats_display_account_notifications
nats_display_account_preview
nats_display_admin_links
nats_display_admin_message
nats_display_adtool_form
nats_display_adtool_types
nats_display_adtools
nats_display_adtools_type_limit
nats_display_choose_adtools_group
nats_display_code_info
nats_display_create_campaign
nats_display_edit_account_details
nats_display_edit_account_settings
nats_display_edit_defaults
nats_display_edit_password
nats_display_edit_payvia
nats_display_edit_payvia_info
nats_display_edit_skin
nats_display_gallery_builder
nats_display_graph
nats_display_hourly_sales
nats_display_latest_adtools
nats_display_map
nats_display_news
nats_display_page_peel
nats_display_payment_history
nats_display_payment_summary
nats_display_ratio
nats_display_reward_category
nats_display_reward_order
nats_display_reward_purchases
nats_display_signup_advanced
nats_display_signup_basic
nats_display_signup_payvia
nats_display_stats
nats_display_stats_calendar
nats_display_stats_form
nats_display_stats_referrals
nats_display_stats_retention
nats_display_stats_subscription_details
nats_display_stats_table
nats_display_timezones
nats_display_top_stats
nats_dump_data
nats_encode
nats_get_first_in_array
nats_get_payment_breakdown
nats_get_period_end
nats_get_reward_categories
nats_get_member
nats_list_adtool_groups
nats_list_affiliates
nats_list_billers
nats_list_campaigns
nats_list_linkcodes
nats_list_options
nats_get_option_details
nats_list_programs
nats_list_sites
nats_list_tool_categories
nats_list_tours
nats_list_xsells
nats_smarty_function_amount_owed
nats_smarty_function_getbonus
nats_smarty_rebuild_form
nats_smarty_rebuild_link
nats_smarty_rebuild_query
nats_tooltip
nats_track_link
nats_strack_link
tmm_admin_pagination
Template Shortcuts
add_to_array
adtool_replace_linkcode
affiliate_select_form
array_flip
array_to_xml
amount_owed
build_array_by_reference
convert_bytes
display_account_campaigns
display_account_change_history
display_account_notifications
display_account_preview
display_admin_links
display_adtool_form
display_adtool_types
display_adtools
display_adtools_type_limit
display_choose_adtools_group
display_code_info
display_create_campaign
display_gallery_builder
display_stats_referrals
display_edit_account_details
display_edit_account_settings
display_edit_defaults
display_edit_password
display_edit_payvia
display_edit_payvia_info
display_edit_skin
display_graph
display_hourly_sales
display_latest_adtools
display_map
display_news
display_page_peel
display_payment_history
display_payment_summary
display_ratio
display_reward_category
display_reward_order
display_reward_purchases
display_signup_advanced
display_signup_basic
display_signup_payvia
display_stats
display_stats_calendar
display_stats_table
display_stats_form
display_stats_retention
display_stats_subscription_details
display_top_stats
display_timezones
dump_data
get_first
get_period_end
get_reward_categories
list_billers
list_campaigns
list_linkcodes
list_options
list_programs
list_sites
list_tool_categories
list_tours
list_xsells
rebuild_form
rebuild_link
rebuild_query
reward_points
tooltip
Common Parameters
assign
assign_prefix
count
data_only
display_on_assign
start
tpl

{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'}