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:

  1. 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.
  1. 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

We strongly recommend using parent relationships to create your order form template.
3. Create and update the desired template files within your custom folder. For each step in the ordering process that you want to customize:

  1. 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.
  2. Copy that order form template file from the defined parent order form template to the new directory.
  3. Make the desired changes to the copy within the custom order form template directory.
  4. 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 FileDescription
addons.tplLists the addons a user can order for their existing packages when they log in.
domain-renewals.tplLists domains in the client’s account. This can also allow for domain renewals to be in advance.
configureproductdomain.tplAllows domain selection for domains for a specific product.
domainoptions.tplFor some templates, displays domain availability check results.
checkout.tplDisplays the checkout page where visitors enter their contact and payment details.
common.tplIncludes CSS elements specific to the order pages.
complete.tplDisplays at the end of the checkout process.
configureproduct.tplConfigures the product before adding it to the cart (for example, the billing cycle, configurable options, or custom fields).
configuredomains.tplChooses domain addons, complete custom field requirements, and custom nameservers.
domainregister.tplDomain searching and suggestions.
domaintransfer.tplDomain transfers eligibility check and EPP code provision.
error.tplAn error page that’s specific to the cart process.
fraudcheck.tplDisplayed if the client fails a fraud check.
linkedaccounts.tplIncludes any activated Social Sign-In Integrations.
marketconnect-promo.tplPromotes MarketConnect products when the client views the cart.
ordersummary.tplDisplays cart contents and product total summaries during the order process.
products.tplLists product categories and products.
sidebar-categories.tplA sidebar that lists group or contextual product information.
sidebar-categories-collapsed.tplThe sidebar-categories.tpl sidebar, collapsed for a smaller viewport.
viewcart.tplDisplays 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 11, 2024