function calculate_price($products_price, $products_tax, $quantity = 1, $rate = "", $pid = "") { global $currency; if (is_numeric($pid)) { $dbres = tep_db_query("select categories_id from products_to_categories where products_id='" . $pid . "'"); $row = tep_db_fetch_array($dbres); $cat_id = (int) $row['categories_id']; if ($cat_id == 23) { return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity; } } if ($rate == "") { $rate = get_price_rate($_SESSION['customer_id']); } if (get_price_group_name($_SESSION['customer_id']) == "Interior Designer") { $dbres = tep_db_query("select dn_price from products where products_id='{$pid}'"); $row = tep_db_fetch_array($dbres); if ((double) $row['dn_price'] > 0) { $products_price = $row['dn_price']; $rate = "100"; } } return ceil(tep_add_tax($products_price * $rate / 100, $products_tax)) * $quantity; // return tep_round(tep_add_tax(($products_price*$rate)/100, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity; }
function display_price($products_price, $products_tax, $quantity = 1, $rate = "", $pid = "") { if ($_SESSION['hide_price'] == 'on' || get_price_rate($_SESSION['customer_id']) == 0) { return ""; } if (get_price_group_name($_SESSION['customer_id']) == 'Retail Store (independent)' || get_price_group_name($_SESSION['customer_id']) == 'Retail Store (stocking dealer)') { return $this->format($this->calculate_price($products_price, $products_tax, $quantity, $rate, (int) $pid)) . '<br><span><small>Minimum Opening Order Required</small></span>'; } return $this->format($this->calculate_price($products_price, $products_tax, $quantity, $rate, (int) $pid)); }
osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- information //--> <tr> <td><span id="infocenter"> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => "Information Center"); new infoBoxHeading($info_box_contents, false, false); $price_group = get_price_group_name($_SESSION['customer_id']); if ($price_group == "SL Staff") { $pdflink = '<a class="nyroModal" href="' . tep_href_link("pdf_prices.php") . '">Print Price List</a><br>'; } else { $pdflink = '<a href="' . tep_href_link("pdf_price.php") . '">Print Price List</a><br>'; } $projects = ' <ul id="nav2" class="dropdown dropdown-vertical"> <li> <a onmouseover="javascript:fill_projects(this, \'na\', 0);" href="javascript:return false;">My Projects ►</a> <ul id="infobox_projects"> <li><a class="nyroModal" href="add_project.php">New</a></li> </ul> </li> </ul><br>'; $info_box_contents = array();
} } if (is_numeric($_SESSION['customer_id'])) { $dbres = tep_db_query("select active from customers where customers_id='" . $_SESSION['customer_id'] . "'"); $row = tep_db_fetch_array($dbres); if ($row['active'] == 0) { tep_redirect("disabled.php"); } } $row = tep_db_fetch_array(tep_db_query("select qtpro from customers where customers_id='" . $_SESSION['customer_id'] . "'")); if ($row['qtpro'] == "1") { $QTPRO = true; } else { $QTPRO = false; } if (get_price_group_name($_SESSION['customer_id']) != "SL Staff" && MAINTENANCE_MODE == "true" && basename($_SERVER['SCRIPT_NAME']) != "login.php") { tep_redirect("login.php"); } // create the shopping cart & fix the cart if necesary if (tep_session_is_registered('cart') && is_object($cart)) { if (PHP_VERSION < 4) { $broken_cart = $cart; $cart = new shoppingCart(); $cart->unserialize($broken_cart); } } else { tep_session_register('cart'); $cart = new shoppingCart(); } // create the shopping cart & fix the cart if necesary if (tep_session_is_registered('cart_cs') && is_object($cart_cs)) {