Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Including shipping and Include tax: Not working

Including shipping and Include tax: Not working

Started by manthram on 7 Feb 2011, 9:42 PM · Views: 1,062

Results 1 to 1 of 1
7 Feb 2011, 9:42 PM
#1
manthram avatar

manthram

New Zenner

Join Date:
Feb 2011
Posts:
2
Plugin Contributions:
0

Including shipping and Include tax: Not working

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.