Twig helpers a theme uses
hostware ships a set of Twig functions themes reach for on nearly every page: reading admin settings, resolving asset URLs, checking permissions, translating strings. This is the short list to keep open while you build.
Extending templates
Two tags drive the theme override system. Both walk the theme -> module -> core chain and both require the namespace form (storefront::path).
{% hw_extends 'storefront::layouts/meta.twig' %}takes the found template as a parent so you can override its blocks. Almost every file in a theme'sresources/views/storefront/tree starts with this.{% hw_include 'storefront::component/product/card.twig' with { product: product } only %}drops the found template inline. Theonlykeyword prevents the parent's variables leaking in, which is what you want for reusable partials.
Reading configuration
{{ theme_config('variant', 'default') }}reads a value declared in the theme'sconfig.xmlfor the current sales channel. The second argument is the fallback.{{ sales_channel_branding('branding_primary') }}reads a branding value the admin saved on the current sales channel (colours, logo, favicon media ids, fonts, border radius).{{ config('some.key') }}reads a system configuration value from theconfigservice.{{ system_setting('key') }}reads a global system setting.
Assets and URLs
{{ asset('themes/hw/mytheme/img/hero.png') }}?v={{ hwCacheId }}resolves a public asset URL. ThehwCacheIdglobal changes on every recompile so browsers pick up new versions.{{ theme_asset('img/hero.png') }}resolves an asset relative to the current theme'spublic/folder without you having to type the vendor and name.{{ media_path(mediaId) }}resolves the URL for a stored media id (a logo or favicon the admin picked in the branding tab).{{ route('storefront.home') }}is the standard Laravel route helper. Use it for every internal storefront link so URLs follow the current locale prefix.
Auth and permissions
{% if auth_check() %}tests whether a customer is signed in.{{ auth_user().first_name }}reads the current customer. Only safe inside anauth_check()guard.{% if hw_can('update', 'saleschannel') %}tests an admin ability. Themes rarely use this because the storefront is customer-facing, but the account area uses it for admin-only widgets.
Translations
Every user-visible string in a theme goes through the trans filter so it can be localised.
{{ 'storefront.product.shop.addToCart'|trans }}
{{ 'storefront.cart.itemCount'|trans({ 'count': cart.items.count() }) }}Translation keys live in lang/<locale>/storefront.php (or under a module's lang/ folder for module strings). See the codebase for the current set.
Storefront context variables
These are populated on every storefront request and are available in any template without you passing them.
salesChannel- the current sales channel model. UsesalesChannel.getCompiledThemeCssUrl(),salesChannel.name, and so on.isAccountPage-truewhen the current route is under the customer account area.isIsolatedCheckout,isInsideCheckoutFlow- the checkout skeleton uses these to switch layout modes.route- the current Laravel route.route.getName()gives its name (used by the sceleton to derive the body class).cart- the current customer's cart, when a cart is loaded on the request.product- the product model on product-detail routes.hwCacheId- the global cache buster you append to every asset URL.themeVariant- the current variant selected in the theme config (empty string when the default is picked).
Utility functions
{{ carbon_now() }}and{{ carbon_parse(dateString) }}return Carbon date objects for formatting and comparison.{{ price|float|currency }}formats money using the sales channel's currency and locale.{{ session_get('key') }}reads a value out of the current session.{{ uniqid('prefix', true) }}generates a stable-per-render id for form fields or SVG references.
When you need a helper not listed here, the source of truth is app/Twig/Extension/Functions/HelperFunctions.php. Every registered function is one new TwigFunction(...) entry, so a quick grep for its name shows you its PHP body.