Not trying to upset Mr. Moderator over here, but his answer was pretty useless, so here's one of my own. Action hooks are pretty much used the same way as the other ones, i.e. assuming you're writing a module, you must first register the hook on install() like this:
public function install()
{
//... stuff here
$this->registerHook('actionValidateOrder');
//... other stuff here
}
Then you add another method to your module's class, named after your hook, beginning with the word "hook" and all in camelCase:
public function hookActionValidateOrder($params)
{
//the thing you want to do when the hook's executed goes here
}
The $params array is populated by the function that executes the hook, so you must find it to know what gets passed to it. In this case it's executed by classes/PaymentModule.php, in the following lines:
// Hook validate order
Hook::exec('actionValidateOrder', array(
'cart' => $this->context->cart,
'order' => $order,
'customer' => $this->context->customer,
'currency' => $this->context->currency,
'orderStatus' => $order_status
));
As you can see, in this case it's passed some objects related to the order. Let's say you want to get the id of the carrier related to the order, then your hook function becomes:
public function hookActionValidateOrder($params)
{
$carrier_id = $params['cart']->id_carrier;
//do whatever with the carrier
}
Hope this makes it clearer.