Difference between revisions of "Order Form Templates"

From WHMCS Documentation

(Remove Fields From Order Form)
Line 22: Line 22:
  
 
You can use variables including {$orderid} {$ordernumber} and {$amount} where necessary to fill in order details.
 
You can use variables including {$orderid} {$ordernumber} and {$amount} where necessary to fill in order details.
 +
 +
==Remove Fields From Order Form==
 +
 +
If you do not want to show one of the default fields on your order form, you can change the field type to hidden and supply a default value of NA. The following example shows to to hide the Address 2 field from the viewcart.tpl page:
 +
 +
Find:
 +
 +
<input type="text" name="address2" style="width:80%;" value="{$clientsdetails.address2}" />
 +
 +
Replace with:
 +
 +
<input type="hidden" name="address2" style="width:80%;" value="NA" />

Revision as of 17:18, 17 November 2009

By default, the cart order process is used and so the templates are in the templates/orderforms/cart folder. Below is a breakdown of what each file is used for:

  • products.tpl - Lists product categories and products
  • adddomain.tpl - First step for domain registration only orders
  • addons.tpl - Lists the addons a user can order for their existing packages when logged in
  • configureproductdomain.tpl - Domain selection for domains attached to a product
  • configproduct.tpl - Configure the product before adding to the cart eg. billing cycle, configurable options, custom fields
  • configuredomains.tpl - Choose domain addons, complete custom field requirements & custom nameservers
  • viewcart.tpl - Showing cart contents & checkout process
  • login.tpl - Used for login for existing users
  • complete.tpl - This page is showed at the end of the checkout process

Third Party Order Conversion/Affiliate Tracking

If you use a third party order conversion tracking system or affiliate system then you may need to insert a code snippet that gets run when a user completes an order. With WHMCS, you would add this to the complete.tpl template file between the ispaid section of code as shown below:

{if $ispaid}
Enter any HTML code which needs to be displayed once a user has
completed the checkout  of their order here - for example
conversion tracking and affiliate tracking scripts
{/if}

You can use variables including {$orderid} {$ordernumber} and {$amount} where necessary to fill in order details.

Remove Fields From Order Form

If you do not want to show one of the default fields on your order form, you can change the field type to hidden and supply a default value of NA. The following example shows to to hide the Address 2 field from the viewcart.tpl page:

Find:

<input type="text" name="address2" style="width:80%;" value="{$clientsdetails.address2}" />

Replace with:

<input type="hidden" name="address2" style="width:80%;" value="NA" />