/** * Return the base price plus the special price * * @param $products_id * @return string */ function oos_get_products_base_price_special_total($products_id) { if (oos_get_products_special_price($products_id) > 0) { $the_final_price = oos_get_products_special_price($products_id) + oos_get_products_base_price($products_id); } else { $the_final_price = 0; } return $the_final_price; }
$product_info = $product_info_result->fields; $info_product_price = ''; $info_product_special_price = ''; $info_product_discount = 0; $info_product_discount_price = ''; $info_base_product_price = ''; $info_base_product_special_price = ''; $info_product_price_list = 0; $info_special_price = ''; $info_product_special_price = ''; if ($_SESSION['member']->group['show_price'] == 1 ) { $info_product_price = $oCurrencies->display_price($product_info['products_price'], oos_get_tax_rate($product_info['products_tax_class_id'])); if ($info_special_price = oos_get_products_special_price($product_info['products_id'])) { $info_product_special_price = $oCurrencies->display_price($info_special_price, oos_get_tax_rate($product_info['products_tax_class_id'])); } else { $info_product_discount = min($product_info['products_discount_allowed'], $_SESSION['member']->group['discount']); if ($info_product_discount != 0 ) { $info_product_special_price = $product_info['products_price']*(100-$info_product_discount)/100; $info_product_discount_price = $oCurrencies->display_price($info_product_special_price, oos_get_tax_rate($product_info['products_tax_class_id'])); } } if ($product_info['products_base_price'] != 1) { $info_base_product_price = $oCurrencies->display_price($product_info['products_price'] * $product_info['products_base_price'], oos_get_tax_rate($product_info['products_tax_class_id'])); if ($info_product_special_price != '') {
$output .= '<channel>' . "\n"; $output .= '<title>' . $feed_title . '</title>' . "\n"; $output .= '<description>' . $feed_description . '</description>' . "\n"; $output .= '<link>' . $site_url . '</link>' . "\n"; $limit = 0; $limit_step = 1000; do { $nLanguageID = intval($_SESSION['language_id']); $productstable = $oostable['products']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT p.products_id, p.products_model, p.products_image, p.products_price,\n p.products_tax_class_id, p.products_quantity, pd.products_name, pd.products_description\n FROM {$productstable} p,\n {$products_descriptiontable} pd\n WHERE p.products_id = pd.products_id\n AND p.products_status >= '1'\n AND p.products_access = '0'\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $products_result = $dbconn->SelectLimit($sql, $limit_step, $limit); $count = $products_result->RecordCount(); if ($count > 0) { while ($products = $products_result->fields) { if ($specialprice = oos_get_products_special_price($products['products_id'])) { $price = $specialprice; } else { $price = $products['products_price']; } if ($price > 0) { $tax = (100 + oos_get_tax_rate($products['products_tax_class_id'])) / 100; $price = number_format($price * $tax, 2, ".", ""); $products_description = $products['products_description']; $products_description = trim($products_description); $products_description = strip_tags($products_description); $products_description = utf8_encode($products_description); /* $output.=' <item>'."\n"; $output.=' <title>' . xmlentities(strip_tags($products['products_name']). " - " . $products['products_model']) . '</title>'."\n"; $output.=' <description>' . xmlentities($products_description) . '</description>'."\n";
$customer_info = $customer_result->fields; $customer = $customer_info['customers_firstname'] . ' ' . $customer_info['customers_lastname'] . ': '; $aWishlist = array(); while ($wishlist = $wishlist_result->fields) { $wl_products_id = oos_get_product_id($wishlist['products_id']); $sql = "SELECT p.products_id, pd.products_name, pd.products_description, p.products_model,\n p.products_image, p.products_price, p.products_base_price, p.products_base_unit,\n p.products_discount_allowed, p.products_tax_class_id, p.products_units_id\n FROM " . $oostable['products'] . " p,\n " . $oostable['products_description'] . " pd\n WHERE p.products_id = '" . intval($wl_products_id) . "'\n AND pd.products_id = p.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $wishlist_product = $dbconn->GetRow($sql); $wishlist_product_price = ''; $wishlist_product_special_price = ''; $wishlist_product_discount = 0; $wishlist_product_discount_price = ''; $wishlist_base_product_price = ''; $wishlist_base_product_special_price = ''; $wishlist_special_price = ''; $wishlist_product_price = $oCurrencies->display_price($wishlist_product['products_price'], oos_get_tax_rate($wishlist_product['products_tax_class_id'])); if ($wishlist_special_price = oos_get_products_special_price($wl_products_id)) { $wishlist_product_special_price = $oCurrencies->display_price($wishlist_special_price, oos_get_tax_rate($wishlist_product['products_tax_class_id'])); } else { $wishlist_product_discount = min($wishlist_product['products_discount_allowed'], $_SESSION['member']->group['discount']); if ($wishlist_product_discount != 0) { $wishlist_special_price = $wishlist_product['products_price'] * (100 - $wishlist_product_discount) / 100; $wishlist_product_discount_price = $oCurrencies->display_price($wishlist_special_price, oos_get_tax_rate($wishlist_product['products_tax_class_id'])); } } if ($wishlist_product['products_base_price'] != 1) { $wishlist_base_product_price = $oCurrencies->display_price($wishlist_product['products_price'] * $wishlist_product['products_base_price'], oos_get_tax_rate($wishlist_product['products_tax_class_id'])); if ($wishlist_special_price != '') { $wishlist_base_product_special_price = $oCurrencies->display_price($wishlist_special_price * $wishlist_product['products_base_price'], oos_get_tax_rate($wishlist_product['products_tax_class_id'])); } } $sql = "SELECT products_options_id, products_options_value_id\n FROM " . $oostable['customers_wishlist_attributes'] . "\n WHERE customers_wishlist_link_id = '" . oos_db_input($wlid) . "'\n AND products_id = '" . $wishlist['products_id'] . "'";
$productstable = $oostable['products']; $products_descriptiontable = $oostable['products_description']; $sql6 = "SELECT p.products_price AS price, p.products_model AS model, pd.products_name AS name FROM $productstable p, $products_descriptiontable pd WHERE p.products_id = '" . (int)$inrec['pid'] . "' AND pd.products_id = p.products_id AND pd.products_languages_id = '" . intval($_SESSION['language_id']) . "'"; $result6 = $dbconn->Execute($sql6); $inrec6 = $result6->fields; // Check to see if the product is on special, and if so use that pricing $sprice = oos_get_products_special_price($inrec['pid']); if ($sprice < 1) { $sprice = $inrec6['price']; } // BEGIN OF ATTRIBUTE DB CODE $prodAttribs = ''; // DO NOT DELETE if (RCS_SHOW_ATTRIBUTES == '1') { $customers_basket_attributestable = $oostable['customers_basket_attributes']; $products_optionstable = $oostable['products_options']; $products_options_valuestable = $oostable['products_options_values']; $attrib_sql = "SELECT cba.products_id AS pid, po.products_options_name AS poname, pov.products_options_values_name AS povname FROM $customers_basket_attributestable cba,
$aFeatured = array(); while ($featured = $featured_result->fields) { $featured_product_price = ''; $featured_product_special_price = ''; $featured_max_product_discount = 0; $featured_product_discount_price = ''; $featured_base_product_price = ''; $featured_base_product_special_price = ''; $featured_special_price = ''; $featured_units = UNITS_DELIMITER . $products_units[$featured['products_units_id']]; $featured_product_price = $oCurrencies->display_price($featured['products_price'], oos_get_tax_rate($featured['products_tax_class_id'])); $featured_special_price = oos_get_products_special_price($featured['products_id']); if (!empty($featured_special_price)) { $featured_product_special_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id'])); } else { $featured_max_product_discount = min($featured['products_discount_allowed'],$_SESSION['member']->group['discount']); if ($featured_max_product_discount != 0 ) { $featured_special_price = $featured['products_price']*(100-$featured_max_product_discount)/100; $featured_product_discount_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id'])); } } if ($featured['products_base_price'] != 1) { $featured_base_product_price = $oCurrencies->display_price($featured['products_price'] * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id'])); if ($featured_special_price != '') {
function products_price_actual($product_id, $actual_price, $products_qty) { $new_price = $actual_price; if ($new_special_price = oos_get_products_special_price($product_id)) { $new_price = $new_special_price; } if ($new_discounts_price = oos_get_products_price_quantity_discount($product_id, $products_qty, $new_price)) { $new_price = $new_discounts_price; } return $new_price; }
Based on: WebMakers.com Added: Discount Quantity Written by Linda McGrath osCOMMERCE@WebMakers.com http://www.thewebmakerscorner.com BOF: WebMakes.com Added: Discount Quantity ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if (!isset($nProductsId)) { $nProductsId = oos_get_product_id($_GET['products_id']); } $the_special = oos_get_products_special_price($nProductsId); $q0 = $product_info['products_quantity_order_min']; $q1 = $product_info['products_discount1_qty']; $q2 = $product_info['products_discount2_qty']; $q3 = $product_info['products_discount3_qty']; $q4 = $product_info['products_discount4_qty']; $col_cnt = 1; if ($product_info['products_discount1'] > 0) { $col_cnt = $col_cnt + 1; } if ($product_info['products_discount2'] > 0) { $col_cnt = $col_cnt + 1; } if ($product_info['products_discount3'] > 0) { $col_cnt = $col_cnt + 1; }
} $whats_new_block = '0'; $productstable = $oostable['products']; $query = "SELECT products_id, products_image, products_tax_class_id, products_units_id, products_price,\n products_base_price, products_base_unit, products_discount_allowed\n FROM {$productstable}\n WHERE products_status >= '1'\n AND (products_access = '0' OR products_access = '" . intval($nGroupID) . "')\n ORDER BY products_date_added DESC"; if ($random_product = oos_random_select($query, MAX_RANDOM_SELECT_NEW)) { $whats_new_block = '1'; $random_product['products_name'] = oos_get_products_name($random_product['products_id']); $whats_new_product_price = ''; $whats_new_product_special_price = ''; $whats_new_max_product_discount = 0; $whats_new_product_discount_price = ''; $whats_new_base_product_price = ''; $whats_new_base_product_special_price = ''; $whats_new_special_price = ''; if ($_SESSION['member']->group['show_price'] == 1) { $whats_new_special_price = oos_get_products_special_price($random_product['products_id']); $whats_new_product_price = $oCurrencies->display_price($random_product['products_price'], oos_get_tax_rate($random_product['products_tax_class_id'])); if (oos_is_not_null($whats_new_product_price)) { $whats_new_product_special_price = $oCurrencies->display_price($whats_new_special_price, oos_get_tax_rate($random_product['products_tax_class_id'])); } else { $whats_new_max_product_discount = min($random_product['products_discount_allowed'], $_SESSION['member']->group['discount']); if ($whats_new_max_product_discount != 0) { $whats_new_special_price = $random_product['products_price'] * (100 - $whats_new_max_product_discount) / 100; $whats_new_product_discount_price = $oCurrencies->display_price($whats_new_special_price, oos_get_tax_rate($random_product['products_tax_class_id'])); } } if ($random_product['products_base_price'] != 1) { $whats_new_base_product_price = $oCurrencies->display_price($random_product['products_price'] * $random_product['products_base_price'], oos_get_tax_rate($random_product['products_tax_class_id'])); if ($whats_new_special_price != '') { $whats_new_base_product_special_price = $oCurrencies->display_price($whats_new_special_price * $random_product['products_base_price'], oos_get_tax_rate($random_product['products_tax_class_id'])); }
OOS [OSIS Online Shop] http://www.oos-shop.de/ Copyright (c) 2003 - 2009 by the OOS Development Team. ---------------------------------------------------------------------- Based on: Written by Linda McGrath osCOMMERCE@WebMakers.com http://www.thewebmakerscorner.com ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if (!($pInfo->products_discount1_qty == 0 and $pInfo->products_discount2_qty == 0 and $pInfo->products_discount3_qty == 0 and $pInfo->products_discount4_qty == 0)) { $the_special = oos_get_products_special_price($_GET['pID']); $q0 = $pInfo->products_quantity_order_min; $q1 = $pInfo->products_discount1_qty; $q2 = $pInfo->products_discount2_qty; $q3 = $pInfo->products_discount3_qty; $q4 = $pInfo->products_discount4_qty; $col_cnt = 1; if ($pInfo->products_discount1 > 0) { $col_cnt = $col_cnt + 1; } if ($pInfo->products_discount2 > 0) { $col_cnt = $col_cnt + 1; } if ($pInfo->products_discount3 > 0) { $col_cnt = $col_cnt + 1; }