Template Files
HmSingleOrderAddon is powered by Smarty template files located in templates/orderforms/HmSingleOrderForm/. This page describes what each template renders and the key variables available.
Template Directory
HmSingleOrderForm/ ├── checkout.tpl ← Outer wrapper (HTML, head, body) ├── products.tpl ← Product & billing cycle selection ├── viewcart.tpl ← Order summary / cart ├── configureproduct.tpl ← Configurable options ├── configuredomains.tpl ← Domain register/transfer/use existing ├── complete.tpl ← Order confirmation └── error.tpl ← Error display
checkout.tpl
The outer wrapper template. It renders the <html>, <head>, <body> skeleton and includes the header, footer, and all WHMCS JavaScript files.
Key variables:
| Variable | Description |
|---|---|
{$company_name} | Your WHMCS company name |
{$logo_url} | Company logo URL |
{$charset} | Page charset |
{$WEB_ROOT} | WHMCS URL root |
{$template} | Template directory name |
This is the best template to edit for:
- Adding custom
<head>tags (analytics scripts, fonts) - Changing the header HTML
- Adding a footer
products.tpl
Renders the product information and billing cycle selector.
Key variables:
| Variable | Description |
|---|---|
{$product.name} | Product name |
{$product.description} | Product description HTML |
{$product.pricing} | Array of billing cycles with prices |
{$billingcycle} | Currently selected billing cycle |
{$promosavings} | Promo savings amount (if promo applied) |
configureproduct.tpl
Renders the configurable options panel.
Key variables:
| Variable | Description |
|---|---|
{$configoptions} | Array of configurable option groups |
{$customfields} | Array of product custom fields |
Each $configoptions item has:
optionname— the option group labeloptions— array of choices withnameandrawprice
configuredomains.tpl
Renders the domain section (register / transfer / use-existing tabs).
Key variables:
| Variable | Description |
|---|---|
{$domains} | Current domain selection state |
{$enabledomainsearch} | Whether domain search is enabled |
{$domainregperiods} | Available registration periods |
{$tlds} | Array of available TLDs |
{$domainpricing} | TLD pricing array |
viewcart.tpl
Renders the order summary/cart section.
Key variables:
| Variable | Description |
|---|---|
{$cartitems} | Array of items in the cart |
{$subtotal} | Subtotal before tax/discount |
{$discount} | Discount amount |
{$tax} | Tax amount |
{$total} | Total due |
{$gateways} | Array of available payment gateways |
complete.tpl
Shown after a successful order.
Key variables:
| Variable | Description |
|---|---|
{$orderid} | The new order ID |
{$invoiceid} | Generated invoice ID |
{$ispaid} | Whether the order was paid immediately |
{$clientarea} | Client area URL |
error.tpl
Shown when an error occurs during checkout.
Key variables:
| Variable | Description |
|---|---|
{$errormessage} | The error message to display |
Editing Templates Safely
Templates are overwritten on update
Template files in HmSingleOrderForm/ are replaced when you update the addon. If you edit templates, keep a diff/backup of your changes so you can re-apply them after each update.
Best practice workflow:
- Keep your template changes in a version-controlled branch
- After each update, run
git diffto see what changed in the core templates - Merge your customizations with the new template code
For small styling changes, prefer SCSS Variables or _custom.scss which are safer to maintain.