Custom checkout rule contributed by a repository app, registered through controllerMappings and run by the e-commerce checkout process to add or adjust cart line items. checkAndAddItems is called while building the checkout preview, and processCheckout is called when a matching line item is committed; both delegate to JavaScript functions named by checkItemsFn and processCheckoutFn, passing a context bean that the script uses to read and add line items.
Implements: CheckoutRuleType
Properties
| Property | Returns | Description |
|---|---|---|
| checkItemsFn | String | Name of the JavaScript function called to check and add line items while the checkout preview is being built. |
| fields | List<ExtraField> | Extra fields the rule contributes to the checkout form, used to collect additional input from the customer. |
| id | String | Unique identifier of this checkout rule type. |
| processCheckoutFn | String | Name of the JavaScript function called to process a matching line item when checkout is committed. |
| title | String | Display title of this checkout rule type, shown to the customer or admin. |
Methods
getId()
Returns: String
Unique identifier of this checkout rule type.
getFields()
Returns: List<ExtraField>
Extra fields the rule contributes to the checkout form, used to collect additional input from the customer.
getCheckItemsFn()
Returns: String
Name of the JavaScript function called to check and add line items while the checkout preview is being built.
getProcessCheckoutFn()
Returns: String
Name of the JavaScript function called to process a matching line item when checkout is committed.
getTitle()
Returns: String
Display title of this checkout rule type, shown to the customer or admin.