Skip to main content

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 CodeTrigger PointPurpose
simplercatalog/controller/common/footer/afterRenders the Simpler checkout button on the page.
simplercatalog/controller/common/header/afterInjects the Simpler SDK script into the page head.
simplercatalog/view/common/cart/afterAdds the Simpler button to the minicart.
simpler_caascatalog/controller/checkout/checkout/beforeRedirects to hosted checkout when CaaS is enabled.
simpler_caas_quickcatalog/controller/extension/quickcheckout/checkout/beforeSame 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.