Ok, now that the coupon_admin of it seems to be wroking I think we've got a solution to make it work during checkout.
Let me know if you think this would work.
Code:
function get_order_total() {
global $order;
if {
$order_total = $order->info['total'];
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
$orderTotalFull = $order_total;
$products = $_SESSION['cart']->get_products();
for ($i=0; $i<sizeof($products); $i++) {
if (!is_product_valid($products[$i]['id'], $_SESSION['cc_id'])) {
$order_total -= $products[$i]['final_price'] * $products[$i]['quantity'];
}
}
$order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total);
return $order_total;
}
}
else {
$order_total_tax = $order->info['tax'];
$order_total = $order->info['total'];
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
$orderTotalFull = $order_total;
$products = $_SESSION['cart']->get_products();
for ($i=0; $i<sizeof($products); $i++) {
if (!is_product_valid($products[$i]['id'], $_SESSION['cc_id'])) {
$order_total -= $products[$i]['final_price'] * $products[$i]['quantity'];
if ($this->include_tax == 'true') {
$products_tax = zen_get_tax_rate($products[$i]['tax_class_id']);
$order_total -= (zen_calculate_tax($products[$i]['final_price'], $products_tax)) * $products[$i]['quantity'];
}
$order_total_tax -= (zen_calculate_tax($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']))) * $products[$i]['quantity'];
}
}
$order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax);
return $order_total;
}
}
After the first if statement we need to say if coupon_tax_exempt in the coupons table = yes do this. BUt I'm not sure how to word it.
Bookmarks