> For the complete documentation index, see [llms.txt](https://docs.tebex.io/creators/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tebex.io/creators/tebex-control-panel/webstore/appearance/template-variables.md).

# Template Variables

{% hint style="info" %}
**Check out our new Storefronts feature!** [Read this article](/creators/tebex-control-panel/storefronts.md).

[Information for Legacy Webstore template users.](/creators/tebex-control-panel/storefronts.md#legacy-webstores)
{% endhint %}

Tebex supports a wide range of **template variables** for use within **custom templates** (written in Twig). These variables allow you to access and display dynamic content such as store details, basket contents, package info, and checkout status.

> Template variables are only available when you're using **Custom Templates**, which require a **Tebex Plus** subscription.

***

### Global Variables (Available Across All Pages)

#### **Store Variables**

| Variable                 | Description                                      |
| ------------------------ | ------------------------------------------------ |
| `store.plan`             | The ID of the plan the store is subscribed to.   |
| `store.branding`         | Whether Tebex branding should be displayed.      |
| `store.name`             | The name of the store.                           |
| `store.currency`         | The currency used by the store.                  |
| `store.googleAnalytics`  | Google Analytics code (if set).                  |
| `store.theme`            | The ID of the active theme.                      |
| `store.css`              | The CSS for the active theme.                    |
| `store.logo`             | The URL of the store logo.                       |
| `store.allowFreeBaskets` | Whether free baskets are allowed.                |
| `store.categories`       | Array of categories in the store.                |
| `store.currencies`       | Array of enabled currencies.                     |
| `store.userMessage`      | Message shown to the user (e.g., success/error). |
| `store.pages`            | Array of custom pages on the store.              |
| `store.locales`          | Available language/locale options.               |

***

#### **Basket Variables**

| Variable           | Description                            |
| ------------------ | -------------------------------------- |
| `basket.username`  | Username of the logged-in player.      |
| `basket.ign`       | Alias of `basket.username`.            |
| `basket.uuid`      | UUID/ID of the logged-in player.       |
| `basket.currency`  | Currency code used in the basket.      |
| `basket.price`     | Total price of the basket.             |
| `basket.packages`  | Array of packages added to the basket. |
| `basket.coupons`   | Array of coupons applied.              |
| `basket.id`        | ID of the basket.                      |
| `basket.copy_link` | Shareable basket URL.                  |

***

#### **Miscellaneous**

| Variable  | Description                      |
| --------- | -------------------------------- |
| `modules` | Raw HTML of the sidebar modules. |

***

### Package Modal Variables

Used within the **package modal popup** context.

| Variable                      | Description                                             |
| ----------------------------- | ------------------------------------------------------- |
| `package.id`                  | ID of the package.                                      |
| `package.name`                | Name of the package.                                    |
| `package.description`         | Package description.                                    |
| `package.price`               | Price of the package.                                   |
| `package.type`                | Type: single purchase or subscription.                  |
| `package.customPrice`         | Whether the customer can enter a custom price.          |
| `package.purchasable`         | If the package can be purchased by the player.          |
| `package.basket`              | Whether the package is already in the basket.           |
| `package.disable_gifting`     | Whether gifting is disabled on this package.            |
| `package.storeGiftingEnabled` | Whether gifting is enabled store-wide.                  |
| `package.image.url`           | URL of the package image.                               |
| `package.image.uploaded`      | If a custom image was uploaded.                         |
| `package.discount`            | Array of applicable discount data.                      |
| `package.reason`              | Reason the package cannot be purchased (if applicable). |

***

### Checkout Flow Variables

| Variable                       | Description                                        |
| ------------------------------ | -------------------------------------------------- |
| `checkout.requiredFields`      | Array of required fields in the checkout process.  |
| `checkout.gateways`            | Array of available payment gateways.               |
| `checkout.unavailableGateways` | Array of disabled or unavailable payment gateways. |

***

### Tips

* These variables can be used inside your **Twig templates** with double curly braces:

  ```twig
  twigCopyEdit{{ store.name }}
  {{ basket.price }}
  ```
* Always check for availability before outputting optional data (e.g. `package.discount`) using Twig conditionals:

  ```twig
  twigCopyEdit{% if package.discount %}
    <p>Discount applied!</p>
  {% endif %}
  ```
