Index: src/includes/modules/order_total/ot_gv.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/includes/modules/order_total/ot_gv.php (revision Local Version) +++ src/includes/modules/order_total/ot_gv.php (revision Shelved Version) @@ -149,14 +149,15 @@ function update_credit_account($i) { global $order, $insert_id, $REMOTE_ADDR; + + //var_dump($order->products); + //die(); if (preg_match('/^GIFT_(\d+)/', addslashes($order->products[$i]['model']),$matches)) { - if($matches[1]) - { - $gv_order_amount = $matches[1]; - } - else - { - $gv_order_amount = ($order->products[$i]['final_price']); + + $gv_product_query = xtc_db_query("select products_price as amount from ".TABLE_PRODUCTS." where products_id = '".$order->products[$i]['id']."'"); + + if ($gv_product_result = xtc_db_fetch_array($gv_product_query)) { + $gv_order_amount = $gv_product_result['amount'] * $order->products[$i]['qty']; } if ($this->credit_tax == 'true') $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100;