GX-Bug #60241 » Gutscheine.patch
| src/includes/modules/order_total/ot_gv.php (revision Shelved Version) | ||
|---|---|---|
| 149 | 149 | |
| 150 | 150 |
function update_credit_account($i) {
|
| 151 | 151 |
global $order, $insert_id, $REMOTE_ADDR; |
| 152 |
|
|
| 153 |
//var_dump($order->products); |
|
| 154 |
//die(); |
|
| 152 | 155 |
if (preg_match('/^GIFT_(\d+)/', addslashes($order->products[$i]['model']),$matches)) {
|
| 153 |
if($matches[1]) |
|
| 154 |
{
|
|
| 155 |
$gv_order_amount = $matches[1]; |
|
| 156 |
} |
|
| 157 |
else |
|
| 158 |
{
|
|
| 159 |
$gv_order_amount = ($order->products[$i]['final_price']); |
|
| 156 |
|
|
| 157 |
$gv_product_query = xtc_db_query("select products_price as amount from ".TABLE_PRODUCTS." where products_id = '".$order->products[$i]['id']."'");
|
|
| 158 |
|
|
| 159 |
if ($gv_product_result = xtc_db_fetch_array($gv_product_query)) {
|
|
| 160 |
$gv_order_amount = $gv_product_result['amount'] * $order->products[$i]['qty']; |
|
| 160 | 161 |
} |
| 161 | 162 |
if ($this->credit_tax == 'true') |
| 162 | 163 |
$gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100; |