Events
The Simpler Checkout extension registers OpenCart events that you can hook into for custom integrations.
Registered Events
The following events are registered during installation:
| Event Code | Trigger Point | Purpose |
|---|---|---|
simpler | catalog/controller/common/footer/after | Renders the Simpler checkout button on the page. |
simpler | catalog/controller/common/header/after | Injects the Simpler SDK script into the page head. |
simpler | catalog/view/common/cart/after | Adds the Simpler button to the minicart. |
simpler_caas | catalog/controller/checkout/checkout/before | Redirects to hosted checkout when CaaS is enabled. |
simpler_caas_quick | catalog/controller/extension/quickcheckout/checkout/before | Same as above, for quick checkout extensions. |
Hooking Into Order Submission
You can register your own after event on the submit endpoint to run custom logic after an order is created through Simpler.
Registering the Event
Add this to your module's install() method:
admin/controller/extension/module/mymodule.php
public function install()
{
$this->load->model('setting/event');
$this->model_setting_event->addEvent(
'mymodule_simpler_listener',
'catalog/controller/extension/module/simpler/v1/submit/after',
'extension/module/mymodule/onSimplerOrder'
);
}
Handling the Event
catalog/controller/extension/module/mymodule.php
public function onSimplerOrder($route, $args, $output)
{
// $output contains the JSON response string from the submit endpoint.
// Decode it to access order_id and request_id.
$data = json_decode($output, true);
if (isset($data['order_id'])) {
$order_id = $data['order_id'];
// Your custom logic here — e.g., sync to ERP, send notifications, etc.
}
}
info
The same pattern works for other API endpoints. Replace v1/submit with v1/quote, v1/products, or v1/feed to hook into those flows.