# nats\_list\_xsells

*Article Topics:* [*Smarty*](https://docs.toomuchmedia.com/getting-started/common-topics/smarty)*,* [*Customization*](https://docs.toomuchmedia.com/getting-started/common-topics/customization)

## Parameters

(*Required parameters in **bold**)*

| Parameter                                                                                                                                 | Description                                                                                                                                              | Possible Values                              | Default Value                                                     | Example                    |
| ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------- | -------------------------- |
| tpl                                                                                                                                       | Template used to display output                                                                                                                          | Any valid template                           | The template, *function\_list\_xsells*                            | tpl="mytemplate"           |
| campaigns                                                                                                                                 | Return only xsells available to list of campaigns. **If set, ignores&#x20;*****campaign*****&#x20;and&#x20;*****use\_default\_campaign*****&#x20;below** | An array reference (see Notes section below) | *None.*                                                           | campaigns="$my\_array"     |
| campaign                                                                                                                                  | Return only xsells available to a single campaign. **If set, ignores&#x20;*****use\_default\_campaign*****&#x20;below**                                  | Any valid campaign number                    | The user's current default campaign                               | campaign="123"             |
| use\_default\_campaign                                                                                                                    | Return only xsells available to the database's stored default program for the current user. (See notes for arguments, *campaign* and *campaigns*, above) | 0 or 1 (exclusive)                           | *None.*                                                           | use\_default\_campaign="1" |
| userid                                                                                                                                    | The user ID number to get campaigns from                                                                                                                 | Any valid user ID number                     | The currently logged in user.                                     | userid="123"               |
| programs                                                                                                                                  | Return only xsells available to a list of programs **If set, ignores&#x20;*****program*****&#x20;below**                                                 | An array reference (see Notes section below) | *None.*                                                           | programs="$my\_array"      |
| program                                                                                                                                   | Returns only xsells available to a single program. **If set, ignores&#x20;*****use\_default\_program*****&#x20;below**                                   | Any valid program ID number                  | The user's default campaign                                       | program="123"              |
| use\_default\_program                                                                                                                     | Returns only xsells available to the database's stored default program for the current user. (See notes for arguments, *program* and *programs*, above)  | 0 or 1 (exclusive)                           | *None.* The default in campaign will apply (see *campaign* above) | use\_default\_campaign="1" |
| sites                                                                                                                                     | Return only xsells available to a list of sites. **If set, ignores&#x20;*****site*****&#x20;and&#x20;*****use\_default\_site*****&#x20;below**           | An array reference (see Notes section below) | *None.*                                                           | sites="$my\_sites"         |
| site                                                                                                                                      | Return only xsells available to a particular site. **If set, ignores&#x20;*****use\_default\_site*****&#x20;below**                                      | Any valid site ID number                     | The user's default site                                           | site="123"                 |
| use\_default\_site                                                                                                                        | Returns only xsells available to the database's stored default site for current user. (See notes for arguments *site* and *sites*, above)                | 0 or 1 (exclusive)                           | *None.* The default site will apply (see *site* above)            | use\_default\_site="1"     |
| [assign\_prefix](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign_prefix) | Prefix output variables with this word. (Click link for details)                                                                                         | Any valid Smarty variable name               | *None.* (No prefix is used)                                       | assign\_prefix="myvar"     |
| [data\_only](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-function-parameters/data_only)         | Set variables but don't display the template                                                                                                             | 1                                            | *None.* The template is displayed.                                | data\_only=1               |

## Output

Output placed in the array *$xsells* and displayed using the template function *function\_list\_xsells.* If the parameter *tpl* is used, output displayed using the template specified in tpl's argument.

## Notes

To make an array reference, create the array using the [nats\_add\_to\_array](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_add_to_array) function.

## See Also

* [nats\_list\_sites](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_list_sites) -- List the available sites
* [nats\_list\_tours](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_list_tours) -- List the available tours
* [nats\_list\_campaigns](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_list_campaigns) -- List the available campaigns
