PayNow

Variables

Read a working template before writing one. Summit is the default PayNow theme and the best reference for everything on this page — a complete, production template you can read end to end. Obsidian is a second, smaller example. Both are open source.

Template Files

Page templates

File NameDescription
index.htmlThe main landing page of your webstore
category.htmlDisplays categories, manages navigation, and product filters
product.htmlDisplays detailed information for a specific product
cart.htmlShows the customer's current shopping cart
complete.htmlConfirms a successful purchase
subscriptions.htmlLists all active and canceled customer subscriptions
account.htmlThe customer's order history
auth_username.htmlUsername entry, for stores that sign customers in by name rather than through a platform login
custom_page.htmlRenders any custom page configured in the dashboard

index.html, category.html, product.html and cart.html cannot be deleted.

Supporting files

File NameDescription
layout.htmlBy convention, the shared shell that page templates {% extends %}
module.*.htmlMarkup for individual modules
schema.jsonDeclares the template's own settings, which the dashboard renders as a form
.css, .jsStatic assets, referenced with asset()
ImagesPNG, JPEG, GIF, SVG and WebP, also referenced with asset()

Files can live in subdirectories. Summit uses this to keep partials/ and svgs/ apart from the page templates. Include them by full path:

Text
{% include 'partials/head.html' %}
{% include 'svgs/cart.html' %}

Global Variables

Common Across All Pages

Variable NameDescription
storeThe currently active store
webstoreInformation about the active hosted webstore
cartThe current customer's cart (NULL if not logged in)
navlinksAll enabled navigation links
tagsAll enabled tags in the store
customerThe logged-in customer (NULL if not logged in)
requestInformation about the current HTTP request
notificationActive customer notification, if any
currencyPreferred customer currency (defaults to store.currency if NULL)
available_currenciesAvailable currencies for currency conversion previews
modulesPre-rendered HTML for all active modules
faviconURL of the favicon image for the webstore
templateThis template's own settings, keyed by the option id in schema.json

cart and customer are NULL for signed-out visitors, which is most of your traffic. Guard every use of them — {% if customer %} — or the storefront breaks for anyone browsing anonymously.

Page-Specific Variables

index.html

Variable NameDescription
productsAn array of all available products

category.html

Variable NameDescription
productsProducts matching the active tag/category
activeTagCurrently active filtering tag
activeTagsArray of active filtering tags
activeNavlinkDetailed object for the active navigation link

product.html

Variable NameDescription
productDetails of the selected product
available_gameserversOptional list of gameserver selections

complete.html

Variable NameDescription
completeInformation about the completed order

subscriptions.html

Variable NameDescription
subscriptionsList of the customer’s subscriptions

account.html

Variable NameDescription
ordersThe customer's orders, newest first
account_viewWhich section the page is showing, for example "orders"

custom_page.html

Variable NameDescription
titleThe page's title
contentThe page's body as HTML — output it with |raw
custom_pagesEvery configured custom page, for building navigation

Template Helpers

Beyond the standard Twig functions and filters, hosted webstores add:

HelperReturns
asset('file')The served URL of a static file in this template. Use it for every CSS, JS and image reference — never hardcode a path
config('id')One template setting by its schema.json option id. Equivalent to template.id
|time_diffA relative time string, such as 3 days ago
Text
<link href="{{ asset('app.css') }}" rel="stylesheet">
<script src="{{ asset('app.js') }}"></script>

<style>
  :root { --primary-color: {{ template['main-color'] }}; }
</style>

{% if config('server_ip') %}<code>{{ config('server_ip') }}</code>{% endif %}

Option ids containing a hyphen have to use bracket syntax — template['main-color'], not template.main-color, which Twig parses as a subtraction.


Prices

Every price is an integer in the currency's smallest unit, so 499 means $4.99. There is no preformatted price string on a product. Divide by 100 and format it yourself.

Read the price from pricing, not from price, so that sales are reflected:

Text
{% if product.pricing.active_sale and product.pricing.price_original > product.pricing.price_final %}
  <s>{{ (product.pricing.price_original / 100)|number_format(2) }}</s>
  {{ (product.pricing.price_final / 100)|number_format(2) }}
{% else %}
  {{ (product.price / 100)|number_format(2) }}
{% endif %}

product.price already reflects the visitor's regional pricing and any tax shown inclusive of price, so it will not always equal the amount you set in the dashboard.

Subscription objects are the exception: they carry preformatted *_amount_str fields alongside the integers, and presentment_total_amount_str is the one to show a customer.


Object Definitions

The store data in templates is the Storefront API's own models, unchanged. Rather than repeat them here, look the object up in the Storefront API models — that reference is generated from the API spec, so it is always current.

Template variableModel
product, productsStorefrontProductDto
cartCartDto, lines as CartLineDto
customerStorefrontCustomerDto
storeStoreDto
tags, activeTag, activeTagsStorefrontTagDto
navlinks, activeNavlinkStorefrontNavLinkDto
subscriptionsStorefrontSubscriptionDto

The objects below have no Storefront API equivalent — they exist only inside templates.


Available Game Server Object

FieldDescription
idUnique server identifier
nameDisplay name of server

Webstore Object

FieldDescription
idUnique webstore ID
slugFriendly URL slug
is_activeWebstore active status
custom_domainCustom domain, if set
custom_domain_verifiedDomain verification status
current_template_idActive template ID
custom_templatesAny associated custom templates

Checkout Complete Object

FieldDescription
textCompletion message or status text

Notification Object

FieldDescription
messageNotification message content
typeType of notification (e.g., error, etc.)

Request Details Object

FieldDescription
urlFull current URL
pathURL path component
queryQuery parameters from the URL
countryIP-based country code
countryNameHuman-readable country name
regionGeographical region of the user
cityCity of origin
isEUCountryBoolean indicating if the request is from the EU

For further details on template syntax and filters, refer to the official Twig documentation.