jonkersdw Posted February 18, 2009 Share Posted February 18, 2009 Hello all, The problem I am having is that I created a coupon code that is for free shipping and since the shipping amount is taxable it adds the tax amount on the shipping to the total. Is there some code that I can include that will fix the problem. EX. Discount Coupon CindyFreeShip applied: -$7.95 Sub-Total: $29.95 Table Rate (Best Way): $7.95 GST 5% + PST 8%: $4.93 Total: $34.88 The Total should be $33.84, but its not because it has the shipping's taxes added onto it which total $1.04. Since the tax rate will be different depending on where the user is, it there a way to see if what the shipping tax amount is and remove it from the total as well? Quote Link to comment Share on other sites More sharing options...
jonkersdw Posted February 18, 2009 Author Share Posted February 18, 2009 Solved. Here is how I did it. In the ot_shipping.php file Find approx: line 55 $order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); Replace with: // Shipping Discount if( is_object( $order->coupon ) ) { if($order->coupon->coupon['coupons_discount_type']=="shipping"){ $order->info['tax'] += tep_calculate_tax(($order->info['shipping_cost'] - ($order->info['shipping_cost'] * $order->coupon->coupon['coupons_discount_amount'])), $shipping_tax); $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax(($order->info['shipping_cost'] - ($order->info['shipping_cost'] * $order->coupon->coupon['coupons_discount_amount'])), $shipping_tax); $order->info['total'] += tep_calculate_tax(($order->info['shipping_cost'] - ($order->info['shipping_cost'] * $order->coupon->coupon['coupons_discount_amount'])), $shipping_tax); }else{ $regular_shipping_taxes = "Yes"; } }else{ $regular_shipping_taxes = "Yes"; } // End of Shipping Discount if($regular_shipping_taxes=="Yes"){ $order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.