Checkout Overrides
Overrides enable developers to bypass standard Bold functionality in favor of custom functionality or rules. For example, a developer may want to use custom tax rules instead of Bold Checkout's built-in tax functionality.
Types of overrides
Bold enables the following types of overrides:
address_validate
discount
inventory
shipping
tax
API overrides vs plugin overrides
You can create an override in one of two ways: via API or via plugin. There are several key ways in which these processes differ:
API overrides | Plugin overrides |
---|---|
Used in integrations. | Used in plugins. |
Applied at the store level. Each order placed on that store uses the override functionality. | Applied at the order level, which enables the plugin to apply the override to just a portion of the orders on a store. |
Always applied immediately after the order is initialized (before any plugin overrides). | Applied after API overrides. |
Because Bold always uses the last override applied, if both an API override and plugin override of the same type (i.e., two tax
overrides) are applied on an order, only the plugin override is used.
Override triggers
Each override is triggered by certain API calls that occur during the Checkout process. The following table shows the API calls that trigger each override:
Override | Triggering API type |
---|---|
address_validate | Set Shipping Address, Update Shipping Address, Set Billing Address, Update Billing Address, and Validate Address |
discount | Validate Discount Code, Add Discount Code, and Process Order |
inventory | Check Inventory and Process Order |
shipping | List Shipping Lines and Set Shipping Line |
tax | Generate Taxes |
Plugin overrides use a prefix of override_
. For example, a tax override has a plugin action called override_tax
.