Articles on: Developer

Using Hooks

To use a Hook in Clientexec you need to create a Snapin ( For instructions creating a Snapin see this ).

Using Invoice-Create as an example:

<?php

require_once 'modules/admin/models/SnapinPlugin.php';

class PluginSamplesnapin extends SnapinPlugin
{
    public $listeners = [
        ["Invoice-Create", "invoiceCreateCallback"]
    ];

    public function invoiceCreateCallback($e)
    {

        if (is_array($e)) {
            $event = $e;
        } else {
            $event = $e->getParams();
        }
        CE_Lib::log(4, $event);
    }
}


A List of Hooks can be found here.

Updated on: 10/09/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!