Custom Tokens

How does it work?

The template system supports the ability for clients to add custom tokens to collect custom information from the customer, i.e. a trial registration code. The information can be collected on a cart line item, individual product, or order level with the ability to make the field optional or required. The custom information will be passed through the keygen URL (if utilized) and the sales email. It also can be utilized in the custom email setup within your delivery methods.

How do you set it up?

The custom input tokens can be used on the Shopping Cart, Customer Details, and/or Single Page Order Form templates. They can be utilized within the basket for each line item, or where the customer completes their billing information as it is very flexible. The other order form templates can include a display version of input field.

By customizing a template you can add the custom token and you can add IF tokens to make it product specific (see the template statement reference).

The following examples show a few different variations of what tokens are available. Notice there are two versions of each token. The token prefixed with "BR" is the Basket Row version of the token and must be placed between the ###BRSTART### and ###BREND###. The other tokens are for general order-level custom fields. The CUSTOM_FIELD_INPUT variant must be placed between the ###START### and ###END### tokens in order to work.

Optional Input Token

###CUSTOM_FIELD_INPUT(field_name)###
###BRCUSTOM_FIELD_INPUT(field_name)###

Required Input Token

###CUSTOM_FIELD_INPUT(field_name, 1)###
###BRCUSTOM_FIELD_INPUT(field_name, 1)###

Display Token

###CUSTOM_FIELD_DISPLAY(field_name)###
###BRCUSTOM_FIELD_DISPLAY(field_name)###

Display Token with Default

###CUSTOM_FIELD_DISPLAY(field_name, "default value")###
###BRCUSTOM_FIELD_DISPLAY(field_name, "default value")###

There is no limitation on the number of custom tokens that can be created. The field name just needs to be unique. The field name can be made up of a-z, A-Z, 0-9, or underscore characters up to 16 characters long.

How does it works with the keygen and sales email?

If a custom token is utilized it will be provided in the keygen URL and sales email, but if it isn't utilized no default will be sent.

For the keygen URL, the fields will be: custom_<field name here>=<user value here>

For the sales email, the fields will be: custom_<field name here>: <user value here>

The order level fields will be included in each item's keygen call and sales email. The item level fields will only be included in the relevant items keygen call and sales email.

How is the custom email setup?

Optionally the custom token information can be sent to the customer by setting it up within the custom email of any delivery methods. It will only be sent to the customer if a custom token was used for that product's delivery method.

Display Token

%%CUSTOM_FIELD(field_name)%%

Display Token with Default

%%CUSTOM_FIELD(field_name, "optional default value")%%
SWREG offers a paypal alternative, affordable ecommerce, payment processing, ecommerce solution, and an online software store with the ability to sell shareware.