View Single Post
  #9  
Old 05-19-2004, 06:07 PM
 
Mod King Mod King is offline
 

Senior Member
  
Join Date: May 2004
Posts: 115
 

Default

Here's the fix i did that seemed to work.

I didn't post the whole function, but here is part of it. I am not sure what versions everyone is using, but this is the fix to mixmans

its in ./funch.php
around line 731 for his, in the function func_calculate_single

I put comments in where i added some lines so everyone can see the change.


Code:
# # Deduct discount # $discount_info = func_query_first("select * from $sql_tbl[discounts] where minprice<='$avail_discount_total' $provider_condition and membership='$customer_info[membership]' order by minprice desc"); $discountall_info = func_query_first("select * from $sql_tbl[discounts] where minprice<='$avail_discount_total' $provider_condition and membership='' order by minprice desc"); if ($discount_info["discount_type"]=="absolute" && $avail_discount_total>0) $discount += $discount_info["discount"]; elseif ($discount_info["discount_type"]=="percent") $discount += $avail_discount_total*$discount_info["discount"]/100; elseif ($discountall_info["discount_type"]=="absolute" && $avail_discount_total>0) $discount += $discountall_info["discount"]; elseif ($discountall_info["discount_type"]=="percent") $discount += $avail_discount_total*$discountall_info["discount"]/100; $total = $total-$discount; //mod king change here $total_shipping -= $discount; $total_taxable_gst-=$discount; $total_taxable_pst-=$discount; //end of lines added $total_taxable-=$discount; if ($total_shipping < 0) $total_shipping = 0; # # Deduct discount by discount coupon # $coupon_discount=0; $coupon_total = 0; $coupon_amount = 0; $discount_coupon_data = func_query_first("select * from $sql_tbl[discount_coupons] where coupon='$discount_coupon' $provider_condition"); if (($discount_coupon_data["productid"]>0) and (($discount_coupon_data["coupon_type"]=="absolute") or ($discount_coupon_data["coupon_type"]=="percent"))) { foreach($products as $product) { if ($product["productid"] == $discount_coupon_data["productid"]) { $coupon_total += $product["price"]*$product["amount"]; $coupon_amount += $product["amount"]; } } if ($discount_coupon_data["coupon_type"]=="absolute") { $coupon_discount = $coupon_amount*$discount_coupon_data["discount"]; } else { $coupon_discount = $coupon_total*$discount_coupon_data["discount"]/100; } } elseif (($discount_coupon_data["categoryid"]>0) and (($discount_coupon_data["coupon_type"]=="absolute") or ($discount_coupon_data["coupon_type"]=="percent"))) { foreach ($products as $product) { if ($product["categoryid"] == $discount_coupon_data["categoryid"]) { $coupon_total += $product["price"]*$product["amount"]; $coupon_amount += $product["amount"]; } } if ($discount_coupon_data["coupon_type"]=="absolute") { $coupon_discount = $coupon_amount*$discount_coupon_data["discount"]; } else { $coupon_discount = $coupon_total*$discount_coupon_data["discount"]/100; } } else { if ($discount_coupon_data["coupon_type"]=="absolute") $coupon_discount = $discount_coupon_data["discount"]; elseif ($discount_coupon_data["coupon_type"]=="percent") $coupon_discount = $total*$discount_coupon_data["discount"]/100; } if ((!$single_mode) and (($discount_coupon_data["provider"] != $provider_for) or (!$products))) $discount_coupon = ""; $total = $total-$coupon_discount; //mod king change here added these 3 lines $total_taxable_gst-=$coupon_discount; $total_taxable-=$coupon_discount; $total_taxable_pst-=$coupon_discount; //end of change $total_shipping -= $coupon_discount; if ($total_shipping<0) $total_shipping = 0;
__________________
Mod King
Reply With Quote