function attributes_price($products_id, $session) { $vamPrice = new vamPrice($session['currency'], $session['customers_status']['customers_status_id'], $_SESSION['customer_id'] ? $_SESSION['customer_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 = vam_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 = '" . $products_id . "' and p.options_id = '" . $option . "' and pd.products_id = p.products_id and p.options_values_id = '" . $value . "'"); $attribute_price = vam_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $attributes_price += $vamPrice->Format($attribute_price['options_values_price'], false, $attribute_price['products_tax_class_id']); } else { $attributes_price -= $vamPrice->Format($attribute_price['options_values_price'], false, $attribute_price['products_tax_class_id']); } } } return $attributes_price; }
$price_netto = vam_round($price, PRICE_PRECISION); $new_price_netto = vam_round($new_price, PRICE_PRECISION); $price = $price * (vam_get_tax_rate($sInfo->products_tax_class_id) + 100) / 100; $new_price = $new_price * (vam_get_tax_rate($sInfo->products_tax_class_id) + 100) / 100; } $price = vam_round($price, PRICE_PRECISION); $new_price = vam_round($new_price, PRICE_PRECISION); echo '<input type="hidden" name="products_up_id" value="' . $sInfo->products_id . '">'; ?> <td class="main"> <?php if ($_GET['action'] == 'new' && isset($_GET['prodID'])) { echo vam_draw_hidden_field('products_id', $_GET['prodID']); echo $fInfo->products_name; } else { echo $sInfo->products_name ? $sInfo->products_name . ' <small>(' . $vamPrice->Format($price, true) . ')</small>' : vam_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); } echo vam_draw_hidden_field('products_price', $sInfo->products_price); ?> </td> </tr> <tr> <td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?> </td> <td class="main"><?php echo vam_draw_input_field('specials_price', $new_price); ?> </td>
$result3 = vam_db_query($query3); while ($line = vam_db_fetch_array($result3)) { $current_value_name = $line['products_options_values_name']; // Print the Current Value Name echo "<TR class=\"" . $rowClass . "\">"; echo "<TD class=\"main\">"; echo "<input type=\"checkbox\" name=\"optionValues[]\" value=\"" . $current_value_id . "\"" . $CHECKED . "> " . $current_value_name . " "; echo "</TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_sortorder\" value=\"" . $sortorder . "\" size=\"4\"></TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_model\" value=\"" . $attribute_value_model . "\" size=\"15\"></TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_stock\" value=\"" . $attribute_value_stock . "\" size=\"4\"></TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $attribute_value_weight . "\" size=\"10\"></TD>"; echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_weight_prefix\"><OPTION value=\"+\"" . $posCheck_weight . ">+<OPTION value=\"-\"" . $negCheck_weight . ">-</SELECT></TD>"; // brutto Admin if (PRICE_IS_BRUTTO == 'true') { $attribute_value_price_calculate = $vamPrice->Format(vam_round($attribute_value_price * ((100 + vam_get_tax_rate(vam_get_tax_class_id($_POST['current_product_id']))) / 100), PRICE_PRECISION), false); } else { $attribute_value_price_calculate = vam_round($attribute_value_price, PRICE_PRECISION); } echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_price\" value=\"" . $attribute_value_price_calculate . "\" size=\"10\">"; // brutto Admin if (PRICE_IS_BRUTTO == 'true') { echo TEXT_NETTO . '<b>' . $vamPrice->Format(vam_round($attribute_value_price, PRICE_PRECISION), true) . '</b> '; } echo "</TD>"; echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-</SELECT></TD>"; echo "</TR>"; // Download function start if (DOWNLOAD_ENABLED == 'true') { $file_list = vam_array_merge(array('0' => array('id' => '', 'text' => SELECT_FILE)), vam_getFiles(DIR_FS_CATALOG . 'download/')); echo "<tr>";
<td><?php echo TEXT_PRODUCTS_PRICE; ?> </td> <?php // calculate brutto price for display if (PRICE_IS_BRUTTO == 'true') { $products_price = vam_round($pInfo->products_price * ((100 + vam_get_tax_rate($pInfo->products_tax_class_id)) / 100), PRICE_PRECISION); } else { $products_price = vam_round($pInfo->products_price, PRICE_PRECISION); } ?> <td><?php echo vam_draw_input_field('products_price', $products_price); if (PRICE_IS_BRUTTO == 'true') { echo TEXT_NETTO . '<b>' . $vamPrice->Format($pInfo->products_price, false) . '</b> '; } ?> </td> </tr> <?php for ($col = 0, $n = sizeof($group_data); $col < $n + 1; $col++) { if ($group_data[$col]['STATUS_NAME'] != '') { ?> <tr> <td><?php echo $group_data[$col]['STATUS_NAME']; ?> </td> <?php if (PRICE_IS_BRUTTO == 'true') {