RE: need a quick help with an order total module
Ian <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.devel |
|---|---|
| Message-ID | <fd20a84035c310ed11538894af7f6efc@osCommerce-Forums> |
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=163164#163164
----------------------------------------------------------------
Joshua,
Congratulatio, you found a bug in the discount coupon code. The code should actually be
[code]
$ratio1 = $f_deduct/$this->get_order_total();
$tod_amount = 0;
reset($order->info['tax_groups']);
while (list($key, $value) = each($order->info['tax_groups'])) {
$tax_rate = tep_get_tax_rate_from_desc($key);
$net = $tax_rate * $order->info['tax_groups'][$key];
if ($net>0) {
$god_amount = $order->info['tax_groups'][$key] * $ratio1;
$tod_amount += $god_amount;
$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
}
}
$order->info['tax'] -= $tod_amount;
$order->info['total'] -= $tod_amount;
[/code]
I hope :)