function attributes_price($products_id, $session)
{
    $attributes_price = 0;
    //DokuMan - 2010-11-13 - set default value
    $xtPrice = new xtcPrice($session['currency'], $session['customers_status']['customers_status_id']);
    if (isset($session['contents'][$products_id]['attributes'])) {
        reset($session['contents'][$products_id]['attributes']);
        while (list($option, $value) = each($session['contents'][$products_id]['attributes'])) {
            $attribute_price_query = xtc_db_query("select pd.products_tax_class_id, p.options_values_price, p.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " p, " . TABLE_PRODUCTS . " pd where p.products_id = '" . xtc_db_input((int) $products_id) . "' and p.options_id = '" . xtc_db_input((int) $option) . "' and pd.products_id = p.products_id and p.options_values_id = '" . xtc_db_input((int) $value) . "'");
            $attribute_price = xtc_db_fetch_array($attribute_price_query);
            if ($attribute_price['price_prefix'] == '+') {
                $attributes_price += $xtPrice->xtcFormat($attribute_price['options_values_price'], false, $attribute_price['products_tax_class_id']);
            } else {
                $attributes_price -= $xtPrice->xtcFormat($attribute_price['options_values_price'], false, $attribute_price['products_tax_class_id']);
            }
        }
    }
    return $attributes_price;
}
        xtc_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array, 'update', 'orders_products_id  = \'' . (int) $order_products['orders_products_id'] . '\'');
    }
    // Produkte Ende
    // OT
    $order_total_query = xtc_db_query("select orders_total_id, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $_POST['oID'] . "'");
    while ($order_total = xtc_db_fetch_array($order_total_query)) {
        if ($old_curr['code'] == DEFAULT_CURRENCY) {
            $xtPrice = new xtcPrice($curr['code'], $order->info['status']);
            $value = $xtPrice->xtcGetPrice('', $format = false, '', '', $order_total['value'], '', $order->customer['ID']);
        } else {
            $xtPrice = new xtcPrice($old_curr['code'], $order->info['status']);
            $nvalue = $xtPrice->xtcRemoveCurr($order_total['value']);
            $xtPrice = new xtcPrice($curr['code'], $order->info['status']);
            $value = $xtPrice->xtcGetPrice('', $format = false, '', '', $nvalue, '', $order->customer['ID']);
        }
        $text = $xtPrice->xtcFormat($value, true);
        $sql_data_array = array('text' => $text, 'value' => xtc_db_prepare_input($value));
        xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array, 'update', 'orders_total_id  = \'' . (int) $order_total['orders_total_id'] . '\'');
    }
    // OT Ende
    xtc_redirect(xtc_href_link(FILENAME_ORDERS_EDIT, 'edit_action=other&oID=' . (int) $_POST['oID']));
}
// Währungswechsel Ende
// Löschfunktionen Anfang:
// Löschen eines Artikels aus der Bestellung Anfang:
if ($action == 'product_delete') {
    xtc_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '" . (int) $_POST['opID'] . "'");
    xtc_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $_POST['oID'] . "' and orders_products_id = '" . (int) $_POST['opID'] . "'");
    //BOF - Dokuman - 2010-03-17 - calculate stock correctly when editing orders
    xtc_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity = products_quantity + " . xtc_db_input($_POST['del_qty']) . " WHERE products_id = " . (int) $_POST['del_pID']);
    //EOF - Dokuman - 2010-03-17 - calculate stock correctly when editing orders
 if (isset($send_by_admin)) {
     require DIR_FS_CATALOG_MODULES . 'payment/banktransfer.php';
     include DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/banktransfer.php';
     $payment_modules = new banktransfer();
 }
 $rec = $payment_modules->info();
 // SEPA info required?
 if (!empty($rec['banktransfer_iban'])) {
     if (!function_exists('xtc_date_short')) {
         require_once DIR_FS_INC . 'xtc_date_short.inc.php';
     }
     $smarty->assign('PAYMENT_BANKTRANSFER_CREDITOR_ID', MODULE_PAYMENT_BANKTRANSFER_CI);
     // set due date based on date_purchased and due_delay
     $due_date = date('Y-m-d', strtotime($order->info['date_purchased'] . ' + ' . MODULE_PAYMENT_BANKTRANSFER_DUE_DELAY . ' days'));
     $smarty->assign('PAYMENT_BANKTRANSFER_DUE_DATE', xtc_date_short($due_date));
     $total = $xtPrice->xtcFormat($order_total['total'], true);
     $smarty->assign('PAYMENT_BANKTRANSFER_TOTAL', $total);
     $smarty->assign('PAYMENT_BANKTRANSFER_MANDATE_REFERENCE', MODULE_PAYMENT_BANKTRANSFER_REFERENCE_PREFIX . $oID);
     $smarty->assign('PAYMENT_BANKTRANSFER_IBAN', $rec['banktransfer_iban']);
     $smarty->assign('PAYMENT_BANKTRANSFER_BANKNAME', $rec['banktransfer_bankname']);
     $sepa_info = $smarty->fetch('db:sepa_info.html');
     $smarty->assign('PAYMENT_INFO_HTML', $sepa_info);
     $smarty->assign('PAYMENT_INFO_TXT', str_replace("<br />", "\n", $sepa_info));
     // separate pre-notification necessary?
     if ($rec['banktransfer_owner_email'] != $order->customer['email_address']) {
         $banktransfer_owner_email = $rec['banktransfer_owner_email'];
         $sepa_html_mail = $smarty->fetch('db:sepa_mail.html');
         $sepa_txt_mail = $smarty->fetch('db:sepa_mail.txt');
         // no pre-notification in order mail
         $smarty->clear_assign('PAYMENT_INFO_HTML');
         $smarty->clear_assign('PAYMENT_INFO_TXT');
	   <?php 
    $price = $sInfo->products_price;
    $new_price = $sInfo->specials_new_products_price;
    if (PRICE_IS_BRUTTO == 'true') {
        $price_netto = xtc_round($price, PRICE_PRECISION);
        $new_price_netto = xtc_round($new_price, PRICE_PRECISION);
        $price = $price * (xtc_get_tax_rate($sInfo->products_tax_class_id) + 100) / 100;
        $new_price = $new_price * (xtc_get_tax_rate($sInfo->products_tax_class_id) + 100) / 100;
    }
    $price = xtc_round($price, PRICE_PRECISION);
    $new_price = xtc_round($new_price, PRICE_PRECISION);
    echo '<input type="hidden" name="products_up_id" value="' . $sInfo->products_id . '">';
    ?>
      
          <div class="main col-xs-12 col-sm-11"><?php 
    echo $sInfo->products_name ? $sInfo->products_name . ' <small>(' . $xtPrice->xtcFormat($price, true) . ')</small>' : xtc_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array);
    echo xtc_draw_hidden_field('products_price', $sInfo->products_price);
    ?>
</div>
	  </div>
          <div class="col-xs-12">
            <div class="main col-xs-12 col-sm-1"><?php 
    echo TEXT_SPECIALS_SPECIAL_PRICE;
    ?>
&nbsp;</div>
            <div class="main  col-xs-12 col-sm-11"><?php 
    echo xtc_draw_input_field('specials_price', $new_price);
    ?>
 </div>
          </div>
          <div class="col-xs-12">
?>
</div>
      <?php 
// calculate brutto price for display
if (PRICE_IS_BRUTTO == 'true') {
    $products_price = xtc_round($pInfo->products_price * ((100 + xtc_get_tax_rate($pInfo->products_tax_class_id)) / 100), PRICE_PRECISION);
} else {
    $products_price = xtc_round($pInfo->products_price, PRICE_PRECISION);
}
?>
    <div class='col-sm-6 col-xs-12 main'><?php 
echo xtc_draw_input_field('products_price', $products_price);
?>
      <?php 
if (PRICE_IS_BRUTTO == 'true') {
    echo TEXT_NETTO . '<strong>' . $xtPrice->xtcFormat($pInfo->products_price, false) . '</strong>  ';
}
?>
    </div>
  </div>
<?php 
for ($col = 1, $n = sizeof($group_data); $col < $n + 1; $col++) {
    //DokuMan - changed $col from 0 to 1 (there is no 0?)
    if ($group_data[$col]['STATUS_NAME'] != '') {
        ?>
  <div class='col-xs-12'>
    <div class='col-sm-6 col-xs-12 main'><?php 
        echo $group_data[$col]['STATUS_NAME'];
        ?>
</div>
      <?php 
 echo '<input type="checkbox" name="optionValues[]" value="' . $current_value_id . '"' . $checked . '>&nbsp;&nbsp;' . $current_value_name . '&nbsp;&nbsp;' . PHP_EOL;
 echo '</td>' . PHP_EOL;
 echo '<td class="main" align="left"><input type="text" name="' . $current_value_id . '_sortorder" value="' . (isset($attr_array['sortorder']) ? $attr_array['sortorder'] : '') . '" size="8"></td>' . PHP_EOL;
 echo '<td class="main" align="left"><input type="text" name="' . $current_value_id . '_model" value="' . (isset($attr_array['attributes_model']) ? $attr_array['attributes_model'] : '') . '" size="15"></td>' . PHP_EOL;
 echo '<td class="main" align="left"><input type="text" name="' . $current_value_id . '_ean" value="' . (isset($attr_array['attributes_ean']) ? $attr_array['attributes_ean'] : '') . '" size="15"></td>' . PHP_EOL;
 echo '<td class="main" align="left"><input type="text" name="' . $current_value_id . '_stock" value="' . (isset($attr_array['attributes_stock']) ? $attr_array['attributes_stock'] : '') . '" size="10"></td>' . PHP_EOL;
 echo '<td style="width:35px;" class="main" align="left">' . PHP_EOL;
 echo '   <select name="' . $current_value_id . '_weight_prefix">' . PHP_EOL;
 echo '     <option value="+"' . (isset($attr_array['posCheck_weight']) ? $attr_array['posCheck_weight'] : '') . '>+</option>' . PHP_EOL;
 echo '     <option value="-"' . (isset($attr_array['negCheck_weight']) ? $attr_array['negCheck_weight'] : '') . '>-</option>' . PHP_EOL;
 echo '    </select>' . PHP_EOL;
 echo '  </td>' . PHP_EOL;
 echo '<td width="10%" class="main" align="left"><input type="text" name="' . $current_value_id . '_weight" value="' . (isset($attr_array['options_values_weight']) ? $attr_array['options_values_weight'] : '') . '" size="10"></td>' . PHP_EOL;
 // brutto Admin
 if (PRICE_IS_BRUTTO == 'true') {
     $attribute_value_price_calculate = $xtPrice->xtcFormat(xtc_round((isset($attr_array['options_values_price']) ? $attr_array['options_values_price'] : 0) * ((100 + xtc_get_tax_rate(xtc_get_tax_class_id($_POST['current_product_id']))) / 100), PRICE_PRECISION), false);
 } else {
     $attribute_value_price_calculate = xtc_round(isset($attr_array['options_values_price']) ? $attr_array['options_values_price'] : 0, PRICE_PRECISION);
 }
 echo '<td style="width:35px;" class="main" align="left">' . PHP_EOL;
 echo '   <select name="' . $current_value_id . '_prefix">' . PHP_EOL;
 echo '     <option value="+"' . (isset($attr_array['posCheck']) ? $attr_array['posCheck'] : '') . '>+</option>' . PHP_EOL;
 echo '     <option value="-"' . (isset($attr_array['negCheck']) ? $attr_array['negCheck'] : '') . '>-</option>' . PHP_EOL;
 echo '    </select>' . PHP_EOL;
 echo '  </td>' . PHP_EOL;
 echo '<td style="white-space: nowrap;" class="main" align="left"><input type="text" name="' . $current_value_id . '_price" value="' . $attribute_value_price_calculate . '" size="10">' . PHP_EOL;
 // brutto Admin
 if (PRICE_IS_BRUTTO == 'true') {
     echo '<span style="font-size:11px">' . TEXT_NETTO . '<strong>' . $xtPrice->xtcFormat(xtc_round(isset($attr_array['options_values_price']) ? $attr_array['options_values_price'] : 0, PRICE_PRECISION), true) . '</strong></span>  ' . PHP_EOL;
 }
 echo '</td>' . PHP_EOL;
 function get_html($p_products_array)
 {
     $coo_properties_control = MainFactory::create_object('PropertiesControl');
     $coo_properties_view = MainFactory::create_object('PropertiesView');
     $t_content_array = array();
     $module_content = array();
     $any_out_of_stock = '';
     $mark_stock = '';
     $coo_seo_boost = MainFactory::create_object('GMSEOBoost');
     $coo_main = new main();
     $xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);
     for ($i = 0, $n = sizeof($p_products_array); $i < $n; $i++) {
         $t_combis_id = $coo_properties_control->extract_combis_id($p_products_array[$i]['id']);
         // check if combis_id is empty
         if ($t_combis_id == '') {
             // combis_id is empty = article without properties
             if (STOCK_CHECK == 'true') {
                 $mark_stock = xtc_check_stock($p_products_array[$i]['id'], $p_products_array[$i]['quantity']);
                 if ($mark_stock) {
                     $_SESSION['any_out_of_stock'] = 1;
                 }
             }
         }
         $image = '';
         if ($p_products_array[$i]['image'] != '') {
             $image = DIR_WS_THUMBNAIL_IMAGES . $p_products_array[$i]['image'];
         }
         //bof gm
         $gm_products_id = $p_products_array[$i]['id'];
         $gm_products_id = str_replace('{', '_', $gm_products_id);
         $gm_products_id = str_replace('}', '_', $gm_products_id);
         $gm_query = xtc_db_query("SELECT gm_show_weight FROM products WHERE products_id='" . $p_products_array[$i]['id'] . "'");
         $gm_array = xtc_db_fetch_array($gm_query);
         if (empty($gm_array['gm_show_weight'])) {
             $p_products_array[$i]['gm_weight'] = 0;
         }
         $gm_product_link = xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($p_products_array[$i]['id'], $p_products_array[$i]['name']) . '&no_boost=1');
         include DIR_FS_CATALOG . 'gm/modules/gm_gprint_order_details_cart.php';
         $t_shipping_time = $p_products_array[$i]['shipping_time'];
         $t_products_weight = $p_products_array[$i]['gm_weight'];
         $t_products_model = $p_products_array[$i]['model'];
         #properties
         if ($t_combis_id != '') {
             $t_properties_html = $coo_properties_view->get_order_details_by_combis_id($t_combis_id, 'cart');
             $coo_products = MainFactory::create_object('GMDataObject', array('products', array('products_id' => $p_products_array[$i]['id'])));
             $use_properties_combis_quantity = $coo_products->get_data_value('use_properties_combis_quantity');
             if ($use_properties_combis_quantity == 1) {
                 // check article quantity
                 $mark_stock = xtc_check_stock($p_products_array[$i]['id'], $p_products_array[$i]['quantity']);
                 if ($mark_stock) {
                     $_SESSION['any_out_of_stock'] = 1;
                 }
             } else {
                 if ($use_properties_combis_quantity == 0 && ATTRIBUTE_STOCK_CHECK == 'true' && STOCK_CHECK == 'true' || $use_properties_combis_quantity == 2) {
                     // check combis quantity
                     $t_properties_stock = $coo_properties_control->get_properties_combis_quantity($t_combis_id);
                     if ($t_properties_stock < $p_products_array[$i]['quantity']) {
                         $_SESSION['any_out_of_stock'] = 1;
                         $mark_stock = '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';
                     }
                 }
             }
             $t_weight = $coo_properties_control->get_properties_combis_weight($t_combis_id);
             if ($coo_products->get_data_value('use_properties_combis_weight') == 1) {
                 $t_products_weight = gm_prepare_number($t_weight, $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']);
             } else {
                 $t_products_weight = gm_prepare_number($t_weight + $p_products_array[$i]['weight'], $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']);
             }
             if ($coo_products->get_data_value('use_properties_combis_shipping_time') == 1) {
                 $t_shipping_time = $coo_properties_control->get_properties_combis_shipping_time($t_combis_id);
             }
             $t_combi_model = $coo_properties_control->get_properties_combis_model($t_combis_id);
             if (APPEND_PROPERTIES_MODEL == "true") {
                 // Artikelnummer (Kombi) an Artikelnummer (Artikel) anhängen
                 if ($t_products_model != '' && $t_combi_model != '') {
                     $t_products_model = $t_products_model . '-' . $t_combi_model;
                 } else {
                     if ($t_combi_model != '') {
                         $t_products_model = $t_combi_model;
                     }
                 }
             } else {
                 // Artikelnummer (Artikel) durch Artikelnummer (Kombi) ersetzen
                 if ($t_combi_model != '') {
                     $t_products_model = $t_combi_model;
                 }
             }
         } else {
             $t_properties_html = '';
         }
         $module_content[$i] = array('PRODUCTS_NAME' => $p_products_array[$i]['name'] . $mark_stock, 'PRODUCTS_QTY' => xtc_draw_input_field('cart_quantity[]', gm_convert_qty($p_products_array[$i]['quantity'], false), ' size="2" onblur="gm_qty_is_changed(' . $p_products_array[$i]['quantity'] . ', this.value, \'' . GM_QTY_CHANGED_MESSAGE . '\')"', 'text', true, "gm_cart_data gm_class_input") . xtc_draw_hidden_field('products_id[]', $p_products_array[$i]['id'], 'class="gm_cart_data"') . xtc_draw_hidden_field('old_qty[]', $p_products_array[$i]['quantity']), 'PRODUCTS_OLDQTY_INPUT_NAME' => 'old_qty[]', 'PRODUCTS_QTY_INPUT_NAME' => 'cart_quantity[]', 'PRODUCTS_QTY_VALUE' => gm_convert_qty($p_products_array[$i]['quantity'], false), 'PRODUCTS_ID_INPUT_NAME' => 'products_id[]', 'PRODUCTS_ID_EXTENDED' => $p_products_array[$i]['id'], 'PRODUCTS_MODEL' => $t_products_model, 'SHOW_PRODUCTS_MODEL' => SHOW_PRODUCTS_MODEL, 'PRODUCTS_SHIPPING_TIME' => $t_shipping_time, 'PRODUCTS_TAX' => (double) $p_products_array[$i]['tax'], 'PRODUCTS_IMAGE' => $image, 'IMAGE_ALT' => $p_products_array[$i]['name'], 'BOX_DELETE' => xtc_draw_checkbox_field('cart_delete[]', $p_products_array[$i]['id'], false, 'id="gm_delete_product_' . $gm_products_id . '"'), 'PRODUCTS_LINK' => $gm_product_link, 'PRODUCTS_PRICE' => $xtPrice->xtcFormat($p_products_array[$i]['price'] * $p_products_array[$i]['quantity'], true), 'PRODUCTS_SINGLE_PRICE' => $xtPrice->xtcFormat($p_products_array[$i]['price'], true), 'PRODUCTS_SHORT_DESCRIPTION' => xtc_get_short_description($p_products_array[$i]['id']), 'ATTRIBUTES' => '', 'PROPERTIES' => $t_properties_html, 'GM_WEIGHT' => $t_products_weight, 'PRODUCTS_ID' => $gm_products_id, 'UNIT' => $p_products_array[$i]['unit_name']);
         //eof gm
         // Product options names
         $attributes_exist = isset($p_products_array[$i]['attributes']) ? 1 : 0;
         if ($attributes_exist == 1) {
             reset($p_products_array[$i]['attributes']);
             while (list($option, $value) = each($p_products_array[$i]['attributes'])) {
                 if (ATTRIBUTE_STOCK_CHECK == 'true' && STOCK_CHECK == 'true' && $value != 0) {
                     $attribute_stock_check = xtc_check_stock_attributes($p_products_array[$i][$option]['products_attributes_id'], $p_products_array[$i]['quantity']);
                     if ($attribute_stock_check) {
                         $_SESSION['any_out_of_stock'] = 1;
                     }
                 }
                 $module_content[$i]['ATTRIBUTES'][] = array('ID' => $p_products_array[$i][$option]['products_attributes_id'], 'MODEL' => xtc_get_attributes_model(xtc_get_prid($p_products_array[$i]['id']), $p_products_array[$i][$option]['products_options_values_name'], $p_products_array[$i][$option]['products_options_name']), 'NAME' => $p_products_array[$i][$option]['products_options_name'], 'VALUE_NAME' => $p_products_array[$i][$option]['products_options_values_name'] . $attribute_stock_check);
                 // BOF GM_MOD GX-Customizer:
                 require DIR_FS_CATALOG . 'gm/modules/gm_gprint_order_details_cart_2.php';
             }
         }
     }
     $total_content = '';
     $total = $_SESSION['cart']->show_total();
     if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == '1' && $_SESSION['customers_status']['customers_status_ot_discount'] != '0.00') {
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
             $price = $total - $_SESSION['cart']->show_tax(false);
         } else {
             $price = $total;
         }
         // BOF GM_MOD
         $discount = round($xtPrice->xtcGetDC($price, $_SESSION['customers_status']['customers_status_ot_discount']), 2);
         $total_content = $_SESSION['customers_status']['customers_status_ot_discount'] . ' % ' . SUB_TITLE_OT_DISCOUNT . ' -' . xtc_format_price($discount, $price_special = 1, $calculate_currencies = false) . '<br />';
         $this->set_content_data('DISCOUNT_TEXT', round((double) $_SESSION['customers_status']['customers_status_ot_discount'], 2) . '% ' . SUB_TITLE_OT_DISCOUNT);
         $this->set_content_data('DISCOUNT_VALUE', '-' . xtc_format_price($discount, $price_special = 1, $calculate_currencies = false));
     }
     if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 0) {
             $total -= $discount;
         }
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
             $total -= $discount;
         }
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
             $total -= $discount;
         }
         $total_content .= SUB_TITLE_SUB_TOTAL . $xtPrice->xtcFormat($total, true) . '<br />';
         $t_total = $xtPrice->xtcFormat($total + $discount, true);
     } else {
         $total_content .= NOT_ALLOWED_TO_SEE_PRICES . '<br />';
     }
     // display only if there is an ot_discount
     if ($customer_status_value['customers_status_ot_discount'] != 0) {
         $total_content .= TEXT_CART_OT_DISCOUNT . $customer_status_value['customers_status_ot_discount'] . '%';
     }
     if (SHOW_SHIPPING == 'true') {
         $this->set_content_data('SHIPPING_INFO', ' ' . SHIPPING_EXCL . '<a href="' . $coo_main->gm_get_shipping_link(true) . '" target="_blank" class="lightbox_iframe"> ' . SHIPPING_COSTS . '</a>');
     }
     if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
         $gm_cart_tax_info = '';
         if (gm_get_conf('TAX_INFO_TAX_FREE') == 'true') {
             $gm_cart_tax_info = GM_TAX_FREE . '<br />';
             $this->set_content_data('TAX_FREE_TEXT', GM_TAX_FREE);
         } else {
             $gm_cart_tax_info = $_SESSION['cart']->show_tax();
             if (!empty($gm_cart_tax_info) && $_SESSION['customers_status']['customers_status_show_price_tax'] == '0' && $_SESSION['customers_status']['customers_status_add_tax_ot'] == '1') {
                 if (!defined(MODULE_ORDER_TOTAL_SUBTOTAL_TITLE_NO_TAX)) {
                     include_once DIR_FS_CATALOG . 'lang/' . $_SESSION['language'] . '/modules/order_total/ot_subtotal.php';
                 }
                 $t_gm_tax = 0;
                 foreach ($_SESSION['cart']->tax as $t_gm_key => $t_gm_value) {
                     $t_gm_tax += $t_gm_value['value'];
                 }
                 $gm_cart_tax_info = MODULE_ORDER_TOTAL_SUBTOTAL_TITLE_NO_TAX . ': ' . $xtPrice->xtcFormat((double) $total - (double) $t_gm_tax, true) . '<br />' . $gm_cart_tax_info;
                 $t_total = $xtPrice->xtcFormat((double) $total - (double) $t_gm_tax + $discount, true);
             }
         }
         $this->set_content_data('UST_CONTENT', $gm_cart_tax_info, 1);
     }
     $t_taxes_data_array = explode('<br />', $_SESSION['cart']->show_tax(true));
     $t_tax_array = array();
     for ($i = 0; $i < count($t_taxes_data_array); $i++) {
         if (!empty($t_taxes_data_array[$i])) {
             $t_tax_data_array = explode(':', $t_taxes_data_array[$i]);
             $t_tax_array[] = array('TEXT' => $t_tax_data_array[0], 'VALUE' => $t_tax_data_array[1]);
         }
     }
     $this->set_content_data('tax_data', $t_tax_array);
     $this->set_content_data('SUBTOTAL', $t_total);
     $this->set_content_data('TOTAL', $xtPrice->xtcFormat($total, true));
     $this->set_content_data('TOTAL_CONTENT', $total_content, 1);
     $this->set_content_data('language', $_SESSION['language']);
     $this->set_content_data('module_content', $module_content);
     $coo_gift_cart = MainFactory::create_object('GiftCartContentView');
     $t_view_html = $coo_gift_cart->get_html();
     $this->set_content_data('MODULE_gift_cart', $t_view_html);
     // Bitcoin Payment - Commerce Coding - BEGIN
     $multiplier = 1;
     $digits = 8;
     switch (MODULE_PAYMENT_BITCOIN_UNITS) {
         case 'uBTC':
             $multiplier *= 1000;
             $digits -= 3;
         case 'mBTC':
             $multiplier *= 1000;
             $digits -= 3;
         case 'BTC':
             $btcPrice = number_format($total / MODULE_PAYMENT_BITCOIN_BTCEUR * $multiplier, $digits, '.', '');
             $this->set_content_data('BITCOIN_PRICE', $btcPrice . ' ' . MODULE_PAYMENT_BITCOIN_UNITS);
     }
     // Bitcoin Payment - Commerce Coding - END
     $t_html_output = $this->build_html();
     return $t_html_output;
 }
 }
 //BOF - web28 - 2011-04-13 - ADD Coupon message infos
 //$coupon_query = xtc_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $_GET['cid'] . "'");
 $coupon_query = xtc_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . (int) $_GET['cid'] . "'");
 //EOF - web28 - 2011-04-13 - ADD Coupon message infos
 $coupon_result = xtc_db_fetch_array($coupon_query);
 $coupon_name_query = xtc_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . (int) $_GET['cid'] . "' and language_id = '" . (int) $_SESSION['languages_id'] . "'");
 $coupon_name = xtc_db_fetch_array($coupon_name_query);
 //BOF - web28 - 2011-04-13 - ADD Coupon message infos
 require DIR_FS_CATALOG . DIR_WS_CLASSES . 'xtcPrice.php';
 $xtPrice = new xtcPrice(DEFAULT_CURRENCY, 1);
 $coupon_amount = '';
 if ($coupon_result['coupon_type'] == 'S') {
     $coupon_amount = COUPON_INFO . COUPON_FREE_SHIPPING;
 } else {
     $coupon_amount = COUPON_INFO . $xtPrice->xtcFormat($coupon_result['coupon_amount'], true) . ' ';
 }
 if ($coupon_result['coupon_type'] == 'P') {
     $coupon_amount = COUPON_INFO . number_format($coupon_result['coupon_amount'], 2) . '% ';
 }
 if ($coupon_result['coupon_minimum_order'] > 0) {
     $coupon_amount .= COUPON_MINORDER_INFO . $xtPrice->xtcFormat($coupon_result['coupon_minimum_order'], true) . ' ';
 }
 if (trim($coupon_result['restrict_to_products']) != '' || trim($coupon_result['restrict_to_categories']) != '') {
     $coupon_amount .= COUPON_RESTRICT_INFO;
 }
 //TODO - Anzeige der g�ltigen Artikel/Kategorien
 //EOF - web28 - 2011-04-13 - ADD Coupon message infos
 $from = xtc_db_prepare_input($_POST['from']);
 $subject = xtc_db_prepare_input($_POST['subject']);
 while ($mail = xtc_db_fetch_array($mail_query)) {
 function get_html($p_coo_product, $p_current_category_id = 0)
 {
     $t_html_output = '';
     $xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);
     $main = new main();
     $group_check = '';
     // xs:booster start (v1.041)
     $xsb_tx = array();
     if (@is_array($_SESSION['xtb0']['tx'])) {
         foreach ($_SESSION['xtb0']['tx'] as $tx) {
             if ($tx['products_id'] == $p_coo_product->data['products_id']) {
                 $xsb_tx = $tx;
                 break;
             }
         }
     }
     // xs:booster end
     if (!is_object($p_coo_product) || !$p_coo_product->isProduct()) {
         // product not found in database
         $error = TEXT_PRODUCT_NOT_FOUND;
         include DIR_WS_MODULES . FILENAME_ERROR_HANDLER;
         $t_html_output = $main_content;
     } else {
         if (ACTIVATE_NAVIGATOR == 'true') {
             $coo_product_navigator = MainFactory::create_object('ProductNavigatorContentView');
             $t_view_html = $coo_product_navigator->get_html($p_coo_product, $p_current_category_id);
             $this->set_content_data('PRODUCT_NAVIGATOR', $t_view_html);
         }
         xtc_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . $p_coo_product->data['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
         $products_price = $xtPrice->xtcGetPrice($p_coo_product->data['products_id'], $format = true, 1, $p_coo_product->data['products_tax_class_id'], $p_coo_product->data['products_price'], 1);
         // check if customer is allowed to add to cart
         // BOF GM_MOD:
         if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             // fsk18
             if ($_SESSION['customers_status']['customers_fsk18'] == '1') {
                 if ($p_coo_product->data['products_fsk18'] == '0') {
                     // BOF GM_MOD:
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', gm_convert_qty($p_coo_product->data['gm_min_order'], false), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                     $t_quantity = gm_convert_qty($p_coo_product->data['gm_min_order'], false);
                     $t_disabled_quantity = 0;
                     if (@$xsb_tx['XTB_ALLOW_USER_CHQTY'] == 'true' || $xsb_tx['products_id'] != $p_coo_product->data['products_id']) {
                         $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', str_replace('.', ',', (double) $p_coo_product->data['gm_min_order']), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                     } else {
                         $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', '1', 'disabled="disabled" style="background-color:gray;"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_attr_calc_qty"'));
                         $t_quantity = 1;
                         $t_disabled_quantity = 1;
                     }
                     $this->set_content_data('QUANTITY', $t_quantity);
                     $this->set_content_data('DISABLED_QUANTITY', $t_disabled_quantity);
                     $this->set_content_data('ADD_CART_BUTTON', xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'id="cart_button"'));
                     if (gm_get_conf('GM_SHOW_WISHLIST') == 'true') {
                         $this->set_content_data('ADD_WISHLIST_BUTTON', '<a href="javascript:submit_to_wishlist()" id="gm_wishlist_link">' . xtc_image_button('button_in_wishlist.gif', NC_WISHLIST) . '</a>');
                     }
                 } else {
                     $this->set_content_data('GM_PID', xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 }
             } else {
                 // BOF GM_MOD:
                 $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', gm_convert_qty($p_coo_product->data['gm_min_order'], false), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 $t_quantity = gm_convert_qty($p_coo_product->data['gm_min_order'], false);
                 $t_disabled_quantity = 0;
                 if (@$xsb_tx['XTB_ALLOW_USER_CHQTY'] == 'true' || $xsb_tx['products_id'] != $p_coo_product->data['products_id']) {
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', str_replace('.', ',', (double) $p_coo_product->data['gm_min_order']), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 } else {
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', '1', 'disabled="disabled" style="background-color:gray;"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_attr_calc_qty"'));
                     $t_quantity = 1;
                     $t_disabled_quantity = 1;
                 }
                 $this->set_content_data('QUANTITY', $t_quantity);
                 $this->set_content_data('DISABLED_QUANTITY', $t_disabled_quantity);
                 $this->set_content_data('ADD_CART_BUTTON', xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'id="cart_button"'));
                 if (gm_get_conf('GM_SHOW_WISH_LIST') == 'true') {
                     $this->set_content_data('ADD_WISHLIST_BUTTON', '<a href="javascript:submit_to_wishlist()">' . xtc_image_button('button_in_wishlist.gif', NC_WISHLIST) . '</a>');
                 }
             }
         } elseif ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) > 0 || $_SESSION['customers_status']['customers_status_show_price'] == '0') {
             $this->set_content_data('GM_PID', xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
         }
         if ($p_coo_product->data['products_fsk18'] == '1') {
             $this->set_content_data('PRODUCTS_FSK18', 'true');
         }
         // BOF GM_MOD:
         if (ACTIVATE_SHIPPING_STATUS == 'true' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             $this->set_content_data('SHIPPING_NAME', $main->getShippingStatusName($p_coo_product->data['products_shippingtime']));
             $this->set_content_data('SHIPPING_IMAGE', $main->getShippingStatusImage($p_coo_product->data['products_shippingtime']));
         }
         // BOF_GM_MOD:
         $this->set_content_data('FORM_ACTION', xtc_draw_form('cart_quantity', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'name="cart_quantity" onsubmit="gm_qty_check = new GMOrderQuantityChecker(); return gm_qty_check.check();"'));
         $this->set_content_data('FORM_ACTION_URL', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array('action')) . 'action=add_product'));
         $this->set_content_data('FORM_ID', 'cart_quantity');
         $this->set_content_data('FORM_NAME', 'cart_quantity');
         $this->set_content_data('FORM_METHOD', 'post');
         // BOF GM_MOD GX-Customizer
         $coo_gm_gprint_product_manager = new GMGPrintProductManager();
         if ($coo_gm_gprint_product_manager->get_surfaces_groups_id($p_coo_product->data['products_id']) !== false) {
             $coo_gm_gprint_configuration = new GMGPrintConfiguration($_SESSION['languages_id']);
             $this->set_content_data('GM_GPRINT_SHOW_PRODUCTS_DESCRIPTION', $coo_gm_gprint_configuration->get_configuration('SHOW_PRODUCTS_DESCRIPTION'));
             $this->set_content_data('GM_GPRINT', 1);
         }
         // EOF GM_MOD GX-Customizer
         $this->set_content_data('FORM_END', '</form>');
         $this->set_content_data('PRODUCTS_PRICE', $products_price['formated']);
         if ($p_coo_product->data['products_vpe_status'] == 1 && $p_coo_product->data['products_vpe_value'] != 0.0 && $products_price['plain'] > 0) {
             $this->set_content_data('PRODUCTS_VPE', $xtPrice->xtcFormat($products_price['plain'] * (1 / $p_coo_product->data['products_vpe_value']), true) . TXT_PER . xtc_get_vpe_name($p_coo_product->data['products_vpe']));
         }
         $this->set_content_data('PRODUCTS_ID', $p_coo_product->data['products_id']);
         $this->set_content_data('PRODUCTS_NAME', $p_coo_product->data['products_name']);
         // BOF GM_MOD:
         if ($_SESSION['customers_status']['customers_status_show_price'] != 0 && ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0 || $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 2 && $p_coo_product->data['products_price'] > 0)) {
             // price incl tax
             $tax_rate = $xtPrice->TAX[$p_coo_product->data['products_tax_class_id']];
             $tax_info = $main->getTaxInfo($tax_rate);
             $this->set_content_data('PRODUCTS_TAX_INFO', $tax_info);
             // BOF GM_MOD:
             if ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
                 $this->set_content_data('PRODUCTS_SHIPPING_LINK', $main->getShippingLink(true));
             }
         }
         // BOF GM_MOD
         if (gm_get_conf('GM_TELL_A_FRIEND') == 'true') {
             $this->set_content_data('GM_TELL_A_FRIEND', 1);
         }
         if ($p_coo_product->data['gm_show_price_offer'] == 1 && $_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             $this->set_content_data('GM_PRICE_OFFER', 1);
         }
         if ((double) $p_coo_product->data['gm_min_order'] != 1) {
             $this->set_content_data('GM_MIN_ORDER', gm_convert_qty($p_coo_product->data['gm_min_order'], false));
         }
         if ((double) $p_coo_product->data['gm_graduated_qty'] != 1) {
             $this->set_content_data('GM_GRADUATED_QTY', gm_convert_qty($p_coo_product->data['gm_graduated_qty'], false));
         }
         // EOF GM_MOD
         $this->set_content_data('PRODUCTS_MODEL', $p_coo_product->data['products_model']);
         $this->set_content_data('PRODUCTS_EAN', $p_coo_product->data['products_ean']);
         if ($p_coo_product->data['gm_show_qty_info'] == 1) {
             $this->set_content_data('PRODUCTS_QUANTITY', gm_convert_qty(xtc_get_products_stock($p_coo_product->data['products_id']), false));
             if ($p_coo_product->data['quantity_unit_id'] > 0) {
                 $this->set_content_data('PRODUCTS_QUANTITY_UNIT', $p_coo_product->data['unit_name']);
             }
         }
         // BOF GM_MOD
         if ($p_coo_product->data['gm_show_weight'] == '1') {
             $this->set_content_data('SHOW_PRODUCTS_WEIGHT', 1);
             $this->set_content_data('PRODUCTS_WEIGHT', gm_prepare_number($p_coo_product->data['products_weight'], $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']));
         }
         // EOF GM_MOD
         $this->set_content_data('PRODUCTS_STATUS', $p_coo_product->data['products_status']);
         $this->set_content_data('PRODUCTS_ORDERED', $p_coo_product->data['products_ordered']);
         $this->set_content_data('PRODUCTS_PRINT', '<img src="templates/' . CURRENT_TEMPLATE . '/buttons/' . $_SESSION['language'] . '/print.gif"  style="cursor:hand;" onclick="javascript:window.open(\'' . xtc_href_link(FILENAME_PRINT_PRODUCT_INFO, 'products_id=' . $p_coo_product->data['products_id']) . '\', \'popup\', \'toolbar=0, width=640, height=600\')" alt="" />');
         //GM_MOD:
         $gmTabTokenizer = MainFactory::create_object('GMTabTokenizer', array(stripslashes($p_coo_product->data['products_description'])));
         $gm_products_descrition = $gmTabTokenizer->get_prepared_output();
         $this->set_content_data('PRODUCTS_DESCRIPTION', $gm_products_descrition);
         $t_gm_images_data = array();
         $t_thumbnails_array = array();
         $t_main_max_width = 369;
         $t_main_max_height = 279;
         $t_thumbnail_max_width = 86;
         $t_thumbnail_max_height = 86;
         // BOF GM_MOD
         require_once DIR_FS_CATALOG . 'gm/classes/GMGMotion.php';
         $coo_gm_gmotion = new GMGMotion();
         $this->set_content_data('GMOTION', $coo_gm_gmotion->check_status($p_coo_product->data['products_id']));
         // EOF GM_MOD
         if (isset($xsb_tx['XTB_REDIRECT_USER_TO']) && $xsb_tx['products_id'] == $p_coo_product->data['products_id']) {
             $this->set_content_data('XTB_REDIRECT_USER_TO', $xsb_tx['XTB_REDIRECT_USER_TO']);
         }
         // BOF GM_MOD
         if ($p_coo_product->data['products_image'] != '' && $p_coo_product->data['gm_show_image'] == '1') {
             $t_info_image_size_array = @getimagesize(DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image']);
             $t_thumbnail_image_size_array = @getimagesize(DIR_WS_IMAGES . 'product_images/gallery_images/' . $p_coo_product->data['products_image']);
             $t_main_padding_left = 0;
             $t_main_padding_top = 0;
             if (isset($t_info_image_size_array[0]) && $t_info_image_size_array[0] < $t_main_max_width) {
                 $t_main_padding_left = round(($t_main_max_width - $t_info_image_size_array[0]) / 2);
             }
             if (isset($t_info_image_size_array[1]) && $t_info_image_size_array[1] < $t_main_max_height) {
                 $t_main_padding_top = round(($t_main_max_height - $t_info_image_size_array[1]) / 2);
             }
             $t_zoom_image = DIR_WS_POPUP_IMAGES . $p_coo_product->data['products_image'];
             if (file_exists(DIR_WS_ORIGINAL_IMAGES . $p_coo_product->data['products_image'])) {
                 $t_zoom_image = DIR_WS_ORIGINAL_IMAGES . $p_coo_product->data['products_image'];
             }
             $t_gm_images_data[] = array('IMAGE' => DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image'], 'IMAGE_ALT' => $p_coo_product->data['gm_alt_text'], 'IMAGE_NR' => 0, 'ZOOM_IMAGE' => $t_zoom_image, 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_main_padding_left, 'PADDING_TOP' => $t_main_padding_top, 'WIDTH' => $t_info_image_size_array[0], 'HEIGHT' => $t_info_image_size_array[1]);
             $t_thumbnail_padding_left = 0;
             $t_thumbnail_padding_top = 0;
             if (isset($t_thumbnail_image_size_array[0]) && $t_thumbnail_image_size_array[0] < $t_thumbnail_max_width) {
                 $t_thumbnail_padding_left = round(($t_thumbnail_max_width - $t_thumbnail_image_size_array[0]) / 2);
             }
             if (isset($t_thumbnail_image_size_array[1]) && $t_thumbnail_image_size_array[1] < $t_thumbnail_max_height) {
                 $t_thumbnail_padding_top = round(($t_thumbnail_max_height - $t_thumbnail_image_size_array[1]) / 2);
             }
             $t_thumbnails_array[] = array('IMAGE' => DIR_WS_IMAGES . 'product_images/gallery_images/' . $p_coo_product->data['products_image'], 'IMAGE_ALT' => $p_coo_product->data['gm_alt_text'], 'IMAGE_NR' => 0, 'ZOOM_IMAGE' => $t_zoom_image, 'INFO_IMAGE' => DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image'], 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_thumbnail_padding_left, 'PADDING_TOP' => $t_thumbnail_padding_top);
         }
         $t_gm_images = xtc_get_products_mo_images($p_coo_product->data['products_id']);
         if ($t_gm_images != false) {
             $coo_gm_alt_form = MainFactory::create_object('GMAltText');
             foreach ($t_gm_images as $t_gm_image) {
                 $t_info_image_size_array = @getimagesize(DIR_WS_INFO_IMAGES . $t_gm_image['image_name']);
                 $t_thumbnail_image_size_array = @getimagesize(DIR_WS_IMAGES . 'product_images/gallery_images/' . $t_gm_image['image_name']);
                 $t_main_padding_left = 0;
                 $t_main_padding_top = 0;
                 if (isset($t_info_image_size_array[0]) && $t_info_image_size_array[0] < $t_main_max_width) {
                     $t_main_padding_left = round(($t_main_max_width - $t_info_image_size_array[0]) / 2);
                 }
                 if (isset($t_info_image_size_array[1]) && $t_info_image_size_array[1] < $t_main_max_height) {
                     $t_main_padding_top = round(($t_main_max_height - $t_info_image_size_array[1]) / 2);
                 }
                 $t_zoom_image = DIR_WS_POPUP_IMAGES . $t_gm_image['image_name'];
                 if (file_exists(DIR_WS_ORIGINAL_IMAGES . $t_gm_image['image_name'])) {
                     $t_zoom_image = DIR_WS_ORIGINAL_IMAGES . $t_gm_image['image_name'];
                 }
                 $t_gm_images_data[] = array('IMAGE' => DIR_WS_INFO_IMAGES . $t_gm_image['image_name'], 'IMAGE_ALT' => $coo_gm_alt_form->get_alt($t_gm_image["image_id"], $t_gm_image['image_nr'], $p_coo_product->data['products_id']), 'IMAGE_NR' => $t_gm_image['image_nr'], 'ZOOM_IMAGE' => $t_zoom_image, 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_main_padding_left, 'PADDING_TOP' => $t_main_padding_top, 'IMAGE_POPUP_URL' => DIR_WS_POPUP_IMAGES . $t_gm_image['image_name']);
                 $t_thumbnail_padding_left = 0;
                 $t_thumbnail_padding_top = 0;
                 if (isset($t_thumbnail_image_size_array[0]) && $t_thumbnail_image_size_array[0] < $t_thumbnail_max_width) {
                     $t_thumbnail_padding_left = round(($t_thumbnail_max_width - $t_thumbnail_image_size_array[0]) / 2);
                 }
                 if (isset($t_thumbnail_image_size_array[1]) && $t_thumbnail_image_size_array[1] < $t_thumbnail_max_height) {
                     $t_thumbnail_padding_top = round(($t_thumbnail_max_height - $t_thumbnail_image_size_array[1]) / 2);
                 }
                 $t_thumbnails_array[] = array('IMAGE' => DIR_WS_IMAGES . 'product_images/gallery_images/' . $t_gm_image['image_name'], 'IMAGE_ALT' => $coo_gm_alt_form->get_alt($t_gm_image["image_id"], $t_gm_image['image_nr'], $p_coo_product->data['products_id']), 'IMAGE_NR' => $t_gm_image['image_nr'], 'ZOOM_IMAGE' => $t_zoom_image, 'INFO_IMAGE' => DIR_WS_INFO_IMAGES . $t_gm_image['image_name'], 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_thumbnail_padding_left, 'PADDING_TOP' => $t_thumbnail_padding_top);
             }
         }
         $this->set_content_data('images', $t_gm_images_data);
         $this->set_content_data('thumbnails', $t_thumbnails_array);
         // EOF GM_MOD
         $discount = 0.0;
         if ($_SESSION['customers_status']['customers_status_discount'] != '0.00') {
             // BOF GM_MOD:
             $discount = $_SESSION['customers_status']['customers_status_discount'];
             if ($p_coo_product->data['products_discount_allowed'] < $_SESSION['customers_status']['customers_status_discount']) {
                 $discount = $p_coo_product->data['products_discount_allowed'];
             }
             if ($discount != '0.00') {
                 $this->set_content_data('PRODUCTS_DISCOUNT', $discount . '%');
             }
         }
         // BOF GM_MOD
         if (PRODUCT_IMAGE_INFO_WIDTH < 190 - 16) {
             $this->set_content_data('MIN_IMAGE_WIDTH', 188);
             $this->set_content_data('MIN_INFO_BOX_WIDTH', 156 - 10);
             $this->set_content_data('MARGIN_LEFT', 188 + 10);
         } else {
             $this->set_content_data('MIN_IMAGE_WIDTH', PRODUCT_IMAGE_INFO_WIDTH + 16);
             $this->set_content_data('MIN_INFO_BOX_WIDTH', PRODUCT_IMAGE_INFO_WIDTH + 16 - 32 - 10);
             $this->set_content_data('MARGIN_LEFT', PRODUCT_IMAGE_INFO_WIDTH + 16 + 10);
         }
         // EOF GM_MOD
         $coo_product_attributes = MainFactory::create_object('ProductAttributesContentView', array($p_coo_product->data['options_template']));
         $t_view_html = $coo_product_attributes->get_html($p_coo_product);
         $this->set_content_data('MODULE_product_options', $t_view_html);
         $coo_product_reviews = MainFactory::create_object('ProductReviewsContentView');
         $t_view_html = $coo_product_reviews->get_html($p_coo_product);
         $this->set_content_data('MODULE_products_reviews', $t_view_html);
         if (xtc_not_null($p_coo_product->data['products_url'])) {
             $this->set_content_data('PRODUCTS_URL', sprintf(TEXT_MORE_INFORMATION, xtc_href_link(FILENAME_REDIRECT, 'action=product&id=' . $p_coo_product->data['products_id'], 'NONSSL', true)));
         }
         if ($p_coo_product->data['products_date_available'] > date('Y-m-d H:i:s')) {
             $this->set_content_data('PRODUCTS_DATE_AVIABLE', sprintf(TEXT_DATE_AVAILABLE, xtc_date_long($p_coo_product->data['products_date_available'])));
         } else {
             // BOF GM_MOD:
             if ($p_coo_product->data['products_date_added'] != '0000-00-00 00:00:00' && $p_coo_product->data['gm_show_date_added'] == 1) {
                 $this->set_content_data('PRODUCTS_ADDED', sprintf(TEXT_DATE_ADDED, xtc_date_long($p_coo_product->data['products_date_added'])));
             }
         }
         $coo_product_media = MainFactory::create_object('ProductMediaContentView');
         $t_view_html = $coo_product_media->get_html($p_coo_product->data['products_id'], $_SESSION['languages_id']);
         $this->set_content_data('MODULE_products_media', $t_view_html);
         $coo_graduated_prices = MainFactory::create_object('GraduatedPricesContentView');
         $t_view_html = $coo_graduated_prices->get_html($p_coo_product);
         $this->set_content_data('MODULE_graduated_price', $t_view_html);
         $coo_also_purchased = MainFactory::create_object('AlsoPurchasedContentView');
         $t_view_html = $coo_also_purchased->get_html($p_coo_product);
         $this->set_content_data('MODULE_also_purchased', $t_view_html);
         $coo_cross_selling = MainFactory::create_object('CrossSellingContentView', array('cross_selling'));
         $t_view_html = $coo_cross_selling->get_html($p_coo_product);
         $this->set_content_data('MODULE_cross_selling', $t_view_html);
         $coo_reverse_cross_selling = MainFactory::create_object('CrossSellingContentView', array('reverse_cross_selling'));
         $t_view_html = $coo_reverse_cross_selling->get_html($p_coo_product);
         $this->set_content_data('MODULE_reverse_cross_selling', $t_view_html);
         $i = count($_SESSION['tracking']['products_history']);
         if ($i > 6) {
             array_shift($_SESSION['tracking']['products_history']);
             $_SESSION['tracking']['products_history'][6] = $p_coo_product->data['products_id'];
             $_SESSION['tracking']['products_history'] = array_unique($_SESSION['tracking']['products_history']);
         } else {
             $_SESSION['tracking']['products_history'][$i] = $p_coo_product->data['products_id'];
             $_SESSION['tracking']['products_history'] = array_unique($_SESSION['tracking']['products_history']);
         }
         $coo_stop_watch = new StopWatch();
         $coo_stop_watch->start();
         $coo_properties_view = MainFactory::create_object('PropertiesView', array($_GET, $_POST));
         $t_properties_selection_form = $coo_properties_view->get_selection_form($p_coo_product->data['products_id'], $_SESSION['languages_id']);
         if (trim($t_properties_selection_form) != "") {
             if ($p_coo_product->data['gm_show_qty_info'] == 1) {
                 if ($p_coo_product->data['use_properties_combis_quantity'] == 0 && STOCK_CHECK == 'true' && ATTRIBUTES_STOCK_CHECK == 'true' || $p_coo_product->data['use_properties_combis_quantity'] == 2) {
                     $this->set_content_data('PRODUCTS_QUANTITY', '-');
                     $this->set_content_data('SHOW_PRODUCTS_QUANTITY', true);
                 } else {
                     if ($p_coo_product->data['use_properties_combis_quantity'] == 1) {
                         $this->set_content_data('SHOW_PRODUCTS_QUANTITY', true);
                     }
                 }
             }
             $this->set_content_data('SHOW_PRODUCTS_MODEL', true);
             if (APPEND_PROPERTIES_MODEL == "false" || trim($p_coo_product->data['products_model']) == '') {
                 $this->set_content_data('PRODUCTS_MODEL', '-');
             }
             if (ACTIVATE_SHIPPING_STATUS == 'true' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0 && $p_coo_product->data['use_properties_combis_shipping_time'] == 1) {
                 $this->set_content_data('SHOW_SHIPPING_TIME', true);
                 $this->set_content_data('SHIPPING_NAME', '');
                 $this->set_content_data('SHIPPING_IMAGE', 'admin/images/icons/gray.png');
             }
         }
         $this->set_content_data('properties_selection_form', $t_properties_selection_form);
         $coo_stop_watch->stop();
         //$coo_stop_watch->log_total_time('PropertiesView get_selection_form');
         // BOF GM_MOD
         $t_gm_show_wishlist = gm_get_conf('GM_SHOW_WISHLIST');
         if ($t_gm_show_wishlist == 'true') {
             $this->set_content_data('GM_SHOW_WISHLIST', 1);
         }
         $t_show_facebook = gm_get_conf('SHOW_FACEBOOK');
         if ($t_show_facebook == 'true') {
             $this->set_content_data('SHOW_FACEBOOK', 1);
         }
         $t_show_twitter = gm_get_conf('SHOW_TWITTER');
         if ($t_show_twitter == 'true') {
             $this->set_content_data('SHOW_TWITTER', 1);
         }
         $t_show_googleplus = gm_get_conf('SHOW_GOOGLEPLUS');
         if ($t_show_googleplus == 'true') {
             $this->set_content_data('SHOW_GOOGLEPLUS', 1);
         }
         $t_show_pinterest = gm_get_conf('SHOW_PINTEREST');
         if ($t_show_pinterest == 'true') {
             $this->set_content_data('SHOW_PINTEREST', 1);
         }
         $t_show_print = gm_get_conf('SHOW_PRINT');
         if ($t_show_print == 'true') {
             $this->set_content_data('SHOW_PRINT', 1);
         }
         $t_show_bookmarking = gm_get_conf('SHOW_BOOKMARKING');
         if ($t_show_bookmarking == 'true') {
             $this->set_content_data('SHOW_BOOKMARKING', 1);
         }
         // EOF GM_MOD
         // Bitcoin Payment - Commerce Coding - BEGIN
         $multiplier = 1;
         $digits = 8;
         switch (MODULE_PAYMENT_BITCOIN_UNITS) {
             case 'uBTC':
                 $multiplier *= 1000;
                 $digits -= 3;
             case 'mBTC':
                 $multiplier *= 1000;
                 $digits -= 3;
             case 'BTC':
                 $btcPrice = number_format($products_price['plain'] / MODULE_PAYMENT_BITCOIN_BTCEUR * $multiplier, $digits, '.', '');
                 $this->set_content_data('BITCOIN_PRICE', $btcPrice . ' ' . MODULE_PAYMENT_BITCOIN_UNITS);
         }
         // Bitcoin Payment - Commerce Coding - END
         include_once DIR_FS_DOCUMENT_ROOT . '/shopgate/plugins/gambiogx/system/views/product_info/ProductInfoContentView.inc.php';
         $t_html_output = $this->build_html();
     }
     return $t_html_output;
 }