Custom Order Form Templates
Order Form templates define the look and feel of the shopping cart when your customers place orders. WHMCS ships with several order form templates.
In addition to the defaults that we include with WHMCS, you can create customize your own order form templates.
Creating a Custom Order Form Template
To create a custom order form template:
- Create a new directory or copy one of our Git™ repositories.
- Create or update the
theme.yaml
file. - Create or update the desired template files.
Parent Relationships
To make upgrading and maintaining order form template customizations easier, order form templates support parent-child relationships. Child order form templates inherit template files from their parent template if those files don’t exist in the child template. In this system, you only need to create and maintain the order form template files that you want to customize in order to create your custom template.
For example, the Standard Cart order form template is the parent for the Premium Comparison order form template. Premium Comparison consists only of a products.tpl
order form template file. All of the other steps of the order process use the order form templates and design from the parent order form template, Standard Cart.
Template Files
Order Form templates exist in the /templates/orderforms/
directory. Each subdirectory is a different order form template. Within those directories, you will find the following files:
Template File | Description |
---|---|
addons.tpl | Lists the addons a user can order for their existing packages when they log in. |
domain-renewals.tpl | Lists domains in the client’s account. This can also allow for domain renewals to be in advance. |
configureproductdomain.tpl | Allows domain selection for domains for a specific product. |
domainoptions.tpl | For some templates, displays domain availability check results. |
checkout.tpl | Displays the checkout page where visitors enter their contact and payment details. |
common.tpl | Includes CSS elements specific to the order pages. |
complete.tpl | Displays at the end of the checkout process. |
configureproduct.tpl | Configures the product before adding it to the cart (for example, the billing cycle, configurable options, or custom fields). |
configuredomains.tpl | Chooses domain addons, complete custom field requirements, and custom nameservers. |
domainregister.tpl | Domain searching and suggestions. |
domaintransfer.tpl | Domain transfers eligibility check and EPP code provision. |
error.tpl | An error page that’s specific to the cart process. |
fraudcheck.tpl | Displayed if the client fails a fraud check. |
linkedaccounts.tpl | Includes any activated Social Sign-In Integrations. |
marketconnect-promo.tpl | Promotes MarketConnect products when the client views the cart. |
ordersummary.tpl | Displays cart contents and product total summaries during the order process. |
products.tpl | Lists product categories and products. |
sidebar-categories.tpl | A sidebar that lists group or contextual product information. |
sidebar-categories-collapsed.tpl | The sidebar-categories.tpl sidebar, collapsed for a smaller viewport. |
viewcart.tpl | Displays cart contents, tax estimators, and promotion code applicators. |
Third-Party Order Conversion and Affiliate Tracking
After checkout and payment, a client will see the Order Completed page. The complete.tpl
file in the active order form template directory controls this. This file contains an {if $ispaid}{/if}
section, as in the example below. Code inside these tags runs once a customer pays for an order. Code outside runs regardless of payment status.
{if $ispaid}
Enter any HTML code which needs to display once a user has
completed the checkout of their order here - for example
conversion tracking and affiliate tracking scripts
{/if}
Many variables, including {$orderid}
, {$ordernumber}
, and {$amount}
are available. Use these where necessary to fill in order details.
Last modified: November 19, 2024