| 1 |
<?php |
<?php |
| 2 |
// $Id: ec_store.module,v 1.12.2.65 2009/10/20 02:55:29 davea Exp $ |
// $Id: ec_store.module,v 1.12.2.66 2009/10/25 02:32:55 davea Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 730 |
*/ |
*/ |
| 731 |
function ec_store_transaction_calc_gross($txn) { |
function ec_store_transaction_calc_gross($txn) { |
| 732 |
|
|
|
// no items exist on a pure donation transaction |
|
|
if ($txn->type == 'ec_donate' && $txn->gross) { |
|
|
return $txn->gross; |
|
|
} |
|
|
|
|
| 733 |
$total = 0; |
$total = 0; |
| 734 |
foreach ((array)$txn->items as $item) { |
foreach ((array)$txn->items as $item) { |
| 735 |
$total+= ec_product_has_quantity($item) ? $item->price * $item->qty : $item->price; |
$total+= ec_product_has_quantity($item) ? $item->price * $item->qty : $item->price; |