I wanted to recalculate the total price with the insurance if the customer selected it during checkout. I managed to get it working by modifying the includes/modules/order_total/ot_total.php file. I modified the process() function like this:
function process() {
global $order, $currencies;
///////////// added this: //////////
if (isset($_SESSION['opt_insurance'])) {
$order->info['total'] += $_SESSION['opt_insurance'];
}
//////////////
$this->output[] = array('title' => $this->title . ':',
'text' => $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']),
'value' => $order->info['total']);
}
I am looking for a better way to do this without modifying the ot_total.php file. Do you know a better way to do this?
Thanks