I have enabled "Gift Certificates" and set "Include Shipping" and "Include Tax" to false, but they were being included/deducted if Certificate amount was greater than the Sub Total.

Started looking at the code and found this in ot_gv.php

/**
* Recalculates base order-total amount for use in deduction calculations
*/
function get_order_total() {
global $order;
$order_total = $order->info['total'];
// if we are not supposed to include tax in credit calculations, subtract it out
if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
// if we are not supposed to include shipping amount in credit calcs, subtract it out
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
$order_total = $order->info['total'];
return $order_total;
}

The second from last line, is resetting "order_total" to the original value, after calculating all the deductions.

So, I commented out the line and it started working.

/**
* Recalculates base order-total amount for use in deduction calculations
*/
function get_order_total() {
global $order;
$order_total = $order->info['total'];
// if we are not supposed to include tax in credit calculations, subtract it out
if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
// if we are not supposed to include shipping amount in credit calcs, subtract it out
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
$order_total = $order->info['total'];
//This is resetting deductions, have to comment out to not include
//shipping and tax as per configuration in admin
//return $order_total;
}


I am posting it for zen-cart experts to comment on and if I am correct, possibly fix it in the distributions.