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 custom folder to store the custom order form template files.
- Using a custom folder ensures that they are not overwritten or lost during upgrades. When you upgrade, the system updates any changes to order form template files that WHMCS ships, so upgrades may overwrite direct changes to those files.
- Folder names must be alphanumeric, all lowercase, and may use underscores. The folder name will be the order form template name.
- Create a
theme.yaml
file within the new directory and use it to specify this template’s parent. For example, to set Standard Cart as the parent theme, use this example as the file’s contents:
config:
parent: standard_cart
- Identify the order form template file that controls the step you want to customize. For a list of template files and their functions, see Template Files.
- Copy that order form template file from the defined parent order form template to the new directory.
- Make the desired changes to the copy within the custom order form template directory.
- When you are ready to activate the template, select it in the desired location:
- To use this order form template as the system default, select it for Default Order Form Template in the Ordering tab at Configuration () > System Settings > General Settings.
- To use this order form template for specific product groups, select it for Order Form Template for that product group at Configuration () > System Settings > Products/Services.
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: June 14, 2024