echo '<div class="col-xs-3">'; echo ' <select name="' . $current_value_id . '_weight_prefix">'; echo ' <option value="+"' . (isset($attr_array['posCheck_weight']) ? $attr_array['posCheck_weight'] : '') . '>+</option>'; echo ' <option value="-"' . (isset($attr_array['negCheck_weight']) ? $attr_array['negCheck_weight'] : '') . '>-</option>'; echo ' </select>'; echo '</div>'; echo '<div class="col-xs-9">'; echo '<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; echo '</div>'; echo '</tr>'; // brutto Admin echo '<tr class="' . $rowClass . ' hidden-lg hidden-md">' . PHP_EOL; #hidden-xs hidden-sm echo '<td class="main"><strong>' . ATTR_PRICE . '</strong></td>' . PHP_EOL; 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 '<div class="col-xs-3">'; 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 '</div>'; echo '<div class="col-xs-9">'; echo '<input type="text" name="' . $current_value_id . '_price" value="' . $attribute_value_price_calculate . '" size="10">' . PHP_EOL; echo '</div>'; // brutto Admin if (PRICE_IS_BRUTTO == 'true') {
xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " WHERE products_attributes_id = '" . $delete_res['products_attributes_id'] . "'"); } // download function end xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . $_POST['current_product_id'] . "'"); // Simple, yet effective.. loop through the selected Option Values.. find the proper price & prefix.. insert.. yadda yadda yadda. for ($i = 0; $i < sizeof($_POST['optionValues']); $i++) { $query = "SELECT * \n FROM " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " \n WHERE products_options_values_id = '" . $_POST['optionValues'][$i] . "'"; $result = xtc_db_query($query); $matches = xtc_db_num_rows($result); while ($line = xtc_db_fetch_array($result)) { $optionsID = $line['products_options_id']; } $cv_id = $_POST['optionValues'][$i]; $value_price = $_POST[$cv_id . '_price']; if (PRICE_IS_BRUTTO == 'true') { $value_price = $value_price / (xtc_get_tax_rate(xtc_get_tax_class_id($_POST['current_product_id'])) + 100) * 100; } $value_price = xtc_round($value_price, PRICE_PRECISION); //default values $sql_data_array = array('products_id' => $_POST['current_product_id'], 'options_id' => $optionsID, 'options_values_id' => $_POST['optionValues'][$i], 'options_values_price' => $value_price, 'price_prefix' => $_POST[$cv_id . '_prefix'], 'attributes_model' => xtc_db_prepare_input($_POST[$cv_id . '_model']), 'attributes_stock' => $_POST[$cv_id . '_stock'], 'options_values_weight' => $_POST[$cv_id . '_weight'], 'weight_prefix' => $_POST[$cv_id . '_weight_prefix'], 'sortorder' => $_POST[$cv_id . '_sortorder']); //additional values $add_data_array = array('attributes_ean' => xtc_db_prepare_input($_POST[$cv_id . '_ean'])); $sql_data_array = xtc_array_merge($sql_data_array, $add_data_array); xtc_db_perform(TABLE_PRODUCTS_ATTRIBUTES, $sql_data_array); $products_attributes_id = xtc_db_insert_id(); if ($_POST[$cv_id . '_download_file'] != '') { $value_download_file = $_POST[$cv_id . '_download_file']; $value_download_expire = $_POST[$cv_id . '_download_expire']; $value_download_count = $_POST[$cv_id . '_download_count']; $sql_data_array = array('products_attributes_id' => $products_attributes_id, 'products_attributes_filename' => xtc_db_prepare_input($value_download_file), 'products_attributes_maxdays' => $value_download_expire, 'products_attributes_maxcount' => $value_download_count); xtc_db_perform(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, $sql_data_array);