Advanced Customization using Script

Forms can be further customized using Scripting.

If you have the Scripting permission, you will see editors for pre and post-processing scripts on the Integration tab of forms. Pre-processing Script is executed when a form is accessed before it is displayed. Post-Processing Script is executed after a successful transaction. Note that declined transactions to not execute Post-processing script.

When pre and post-processing script is executed the Context is pre-populated with the following variables:

  • purchaseOrder - contains the current transaction being operated on.

In static pages and community fundraisers:

  • publicPurchaseOrderHome - container for the form and transaction

In catalogs:

  • commerceCampaignFormHome - container for the form
  • commercePurchaseOrderHome - container for the transaction

Integration Codes

Integration codes can be added to forms to be used in customizing their appearance, as variables in scripting, in merge tags in emails and in reports. The item is accessible via the context variable:

  • purchaseOrder.get('custom property name') - the value of the named custom property on the current transaction
  • purchaseOrder.campaign - the form which created the transaction
  • purchaseOrder.campaign.get('custom property name') - the value of the named integration code on the form which created the current transaction

See Advanced Customization using Scripting for more information.