> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_list_xsells.md).

# nats\_list\_xsells

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

## 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](/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign_prefix.md) | 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](/nats-admin/skins-and-templates/further-reading/template-function-parameters/data_only.md)         | 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](/nats-admin/skins-and-templates/further-reading/template-functions/nats_add_to_array.md) function.

## See Also

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_list_xsells.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
