GX-Bug #60240 » CouponGIFTFix.patch
src/includes/modules/order_total/ot_coupon.php (date 1542896733000) | ||
---|---|---|
1013 | 1013 |
for($i = 0; $i < sizeof($products); $i++) |
1014 | 1014 |
{ |
1015 | 1015 |
$t_prid = xtc_get_prid($products[$i]['id']); |
1016 |
$gv_query = xtc_db_query("SELECT |
|
1017 |
products_price, |
|
1016 |
$gv_query = xtc_db_query("SELECT |
|
1018 | 1017 |
products_tax_class_id, |
1019 | 1018 |
products_model |
1020 | 1019 |
FROM " . TABLE_PRODUCTS . " |
1021 | 1020 |
WHERE products_id = '" . $t_prid . "'"); |
1022 | 1021 |
$gv_result = xtc_db_fetch_array($gv_query); |
1022 |
$gv_order_amount = ($order->products[$i]['final_price']); |
|
1023 | 1023 |
|
1024 | 1024 |
if(preg_match('/^GIFT/', $gv_result['products_model'])) |
1025 | 1025 |
{ |
... | ... | |
1028 | 1028 |
|
1029 | 1029 |
if($this->include_tax == 'false') |
1030 | 1030 |
{ |
1031 |
$gv_amount = $gv_result['products_price'] * $qty;
|
|
1031 |
$gv_amount = $gv_order_amount * $qty;
|
|
1032 | 1032 |
} |
1033 | 1033 |
else |
1034 | 1034 |
{ |
1035 |
$gv_amount = ($gv_result['products_price'] + $xtPrice->calcTax($gv_result['products_price'], $products_tax)) * $qty;
|
|
1035 |
$gv_amount = ($gv_order_amount + $xtPrice->calcTax($gv_order_amount, $products_tax)) * $qty;
|
|
1036 | 1036 |
} |
1037 | 1037 |
|
1038 | 1038 |
$order_total = $order_total - $gv_amount; |