Advanced Customization using Script
Items 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 Items. Pre-processing Script is executed when an item is added to a Page - either as part of initial set-up or when constituents add the item to their transaction. 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:
orderItem
- contains the current item in the transaction being operated on.purchaseOrder
- contains the current transaction being operated on.
Integration Codes
Integration codes can be added to items 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:
orderItem.get('custom property name')
- the value of the named custom property on the current line itemorderItem.orderableItem
- the item which created the current line item in the transactionorderItem.orderableItem.get('custom property name')
- the value of the named integration code on the item which created the current line item
See Advanced Customization using Scripting for more information.