Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Where is the "Total" calculated?

Where is the "Total" calculated?

Locked

Views: 951

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
29 Jul 2008, 6:40 AM
#1
chillout_buddha avatar

chillout_buddha

New Zenner

Join Date:
Jan 2006
Posts:
44
Plugin Contributions:
0

Where is the "Total" calculated?

I'm just wondering where is the total calculated (ie, subtotal + shipping). I am referring to Checkout Step 2 that displays the Total amount. I mean which file is it calculated in?

Thanks

29 Jul 2008, 7:19 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Where is the "Total" calculated?

includes/modules/order_total/ot_total.php

29 Jul 2008, 4:02 PM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Where is the "Total" calculated?

Are you having a problem with the way the total is calculated?

30 Jul 2008, 2:26 AM
#4
chillout_buddha avatar

chillout_buddha

New Zenner

Join Date:
Jan 2006
Posts:
44
Plugin Contributions:
0

Re: Where is the "Total" calculated?

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