foreach ($total_extns as $extn) {
$sf_total_mdl = $this->load->model('total/'.$extn['key'], 'storefront');
/**
* parameters are references!!
*
* @var ModelTotalTotal $sf_total_mdl
*/
$sf_total_mdl->getTotal($total_data, $total, $taxes, $this->cust_data);
//trick to change data via hooks
$this->data = [
'total_key' => $extn['key'],
'total_data' => $total_data,
'total' => $total,
'taxes' => $taxes,
];
$this->registry->get('extensions')->hk_ProcessData($this, __FUNCTION__, ['total_text_id' => $extn]);
$total_data = $this->data['total_data'];
$total = $this->data['total'];
$taxes = $this->data['taxes'];
unset(
$this->data['total_key'],
$this->data['total_data'],
$this->data['total'],
$this->data['taxes']
);
$sf_total_mdl = null;
}
I see there is //trick to change data via hooks.