$inp_price = $sa_price + $sp_price;
    $final_price = $inp_price * $_POST['qTY'];
    $sql_data_array = array('products_price' => olc_db_prepare_input($inp_price));
    $update_sql_data = array('final_price' => olc_db_prepare_input($final_price));
    $sql_data_array = olc_array_merge($sql_data_array, $update_sql_data);
    olc_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array, 'update', 'orders_products_id = \'' . olc_db_input($_POST['opID']) . '\'');
    olc_redirect(olc_href_link(FILENAME_ORDERS_EDIT, 'edit_action=options&oID=' . $_POST['oID'] . '&cID=' . $_POST['cID'] . '&pID=' . $_POST['pID'] . '&pTX=' . $_POST['pTX'] . '&aTX=' . $_POST['aTX'] . '&qTY=' . $_POST['qTY'] . '&opID=' . $_POST['opID']));
}
// Produkt Optionen bearbeiten Ende
// Produkt Optionen Einfügen Anfang
if ($_GET['action'] == "product_option_ins") {
    $allow_tax = $_POST['aTX'];
    $customers_status = olc_oe_get_customers_status($_POST['cID']);
    $products_attributes_query = olc_db_query("select\n            products_attributes_id,\n            products_id,\n            options_id,\n            options_values_id,\n            options_values_price,\n            price_prefix,\n            attributes_model,\n            attributes_stock,\n            options_values_weight,\n            weight_prefix,\n            sortorder\n            from\n            " . TABLE_PRODUCTS_ATTRIBUTES . "\n            where\n            products_attributes_id = '" . $_POST['aID'] . APOS);
    $products_attributes = olc_db_fetch_array($products_attributes_query);
    $products_options = olc_oe_get_options_name($products_attributes['options_id']);
    $products_options_values = olc_oe_get_options_values_name($products_attributes['options_values_id']);
    $sql_data_array = array('orders_id' => olc_db_prepare_input($_POST['oID']), 'orders_products_id' => olc_db_prepare_input($_POST['opID']), 'products_options' => olc_db_prepare_input($products_options), 'products_options_values' => olc_db_prepare_input($products_options_values), 'options_values_price' => olc_db_prepare_input($products_attributes['options_values_price']));
    $insert_sql_data = array('price_prefix' => olc_db_prepare_input($products_attributes['price_prefix']));
    $sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);
    olc_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
    $products_query = olc_db_query("select products_id, products_price, products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . $_POST['pID'] . APOS);
    $products = olc_db_fetch_array($products_query);
    $products_a_query = olc_db_query("select options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $_POST['oID'] . "' and orders_products_id = '" . $_POST['opID'] . APOS);
    while ($products_a = olc_db_fetch_array($products_a_query)) {
        $total_price += $products_a['price_prefix'] . $products_a['options_values_price'];
    }
    $sa_price = olc_oe_get_products_attribute_price($total_price, $products['products_tax_class_id'], $price_special = '0', 1, $_POST['prefix'], $calculate_currencies = TRUE_STRING_S, $customers_status);
    $sp_price = olc_oe_products_price($_POST['pID'], $price_special = '0', 1, $customers_status);
    $inp_price = $sa_price + $sp_price;
    $final_price = $inp_price * $_POST['qTY'];
    echo olc_draw_hidden_field('qTY', $_GET['qTY']);
    echo olc_draw_hidden_field('opID', $_GET['opID']);
    echo olc_draw_hidden_field('aID', $products['products_attributes_id']);
    $brutto = PRICE_IS_BRUTTO;
    if ($brutto == TRUE_STRING_S) {
        $options_values_price = olc_round($products['options_values_price'] * (1 + $_GET['pTX'] / 100), PRICE_PRECISION);
    } else {
        $options_values_price = olc_round($products['options_values_price'], PRICE_PRECISION);
    }
    ?>
<td class="dataTableContent"><?php 
    echo $products['products_attributes_id'];
    ?>
</td>
<td class="dataTableContent"><?php 
    echo olc_oe_get_options_name($products['options_id']);
    ?>
</td>
<td class="dataTableContent"><?php 
    echo olc_oe_get_options_values_name($products['options_values_id']);
    ?>
</td>
<td class="dataTableContent">
<?php 
    echo olc_draw_hidden_field('options_values_price', $products['options_values_price']);
    echo $options_values_price;
    ?>
</td>
<td class="dataTableContent">
<?php 
    echo olc_image_submit('button_insert.gif', TEXT_EDIT, 'style="cursor:hand" ');