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 new directory or copy one of our Git™ repositories.
  2. Create or update the theme.yaml file.
  3. 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 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: November 19, 2024