Override Default Checkout Behavior with a Plugin
Plugin overrides are actions that enable Checkout Plugins to bypass certain Bold Checkout behavior in favor of custom functionality.
The following overrides are available to plugin developers:
This document explains the structure of overrides and how to implement them.
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 calls|
|Set Shipping Address, Update Shipping Address, Set Billing Address, Update Billing Address, and Validate Address|
|Validate Discount Code, Add Discount Code, and Process Order|
|Check Inventory and Process Order|
|List Shipping Lines and Set Shipping Line|
The following diagram and steps show an example of setting up and triggering a tax override.
- When a customer proceeds to checkout, the frontend makes a call to the Initialize Order endpoint to begin the checkout process.
- Bold Checkout sends the
initialize_checkoutevent to all plugins registered to receive it on that store. While you can create an override at any point in the checkout flow, establishing the override early ensures that it will be in place before it is needed.
- The plugin responds to Bold Checkout with an
override_taxaction. This payload contains a custom URL defined by the plugin.
- Bold Checkout returns the application state in response to the frontend's Initialize Order call.
- As the customer proceeds through the checkout, they trigger a call to the Generate Taxes endpoint.
- Instead of using Bold Checkout functionality to calculate taxes, Bold Checkout makes a call to the plugin's tax override URL provided in Step 3. Details about this request can be found in the Plugin Actions reference.
- The plugin performs custom tax calculations and responds to Bold Checkout with the appropriate tax information. Details about the response that Bold Checkout expects can be found in the Plugin Actions reference.
- Bold Checkout updates and returns the application state.