[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path Zen Cart 源代码 products_quantity_discounts.php
<?php
/**
* products_quantity_discounts module
*
* @package modules
* @copyright Copyright 2003-2007 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: products_quantity_discounts.php 6477 2007-06-09 04:38:22Z ajeh $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
// if customer authorization is on do not show discounts
$zc_hidden_discounts_on = false;
$zc_hidden_discounts_text = '';
switch (true) {
case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
// customer must be logged in to browse
$zc_hidden_discounts_on = true;
$zc_hidden_discounts_text = 'MUST LOGIN';
break;
case (STORE_STATUS == 1 || CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
// customer may browse but no prices
$zc_hidden_discounts_on = true;
$zc_hidden_discounts_text = TEXT_LOGIN_FOR_PRICE_PRICE;
break;
case (CUSTOMERS_APPROVAL == '3' and TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM != ''):
// customer may browse but no prices
$zc_hidden_discounts_on = true;
$zc_hidden_discounts_text = TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM;
break;
case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customer_id'] == ''):
// customer must be logged in to browse
$zc_hidden_discounts_on = true;
$zc_hidden_discounts_text = TEXT_AUTHORIZATION_PENDING_PRICE;
break;
case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customers_authorization'] > '0'):
// customer must be logged in to browse
$zc_hidden_discounts_on = true;
$zc_hidden_discounts_text = TEXT_AUTHORIZATION_PENDING_PRICE;
break;
default:
// proceed normally
break;
}
// create products discount output table
// find out the minimum quantity for this product
$products_min_query = $db->Execute("select products_quantity_order_min from " . TABLE_PRODUCTS . " where products_id='" . (int)$products_id_current . "'");
$products_quantity_order_min = $products_min_query->fields['products_quantity_order_min'];
// retrieve the list of discount levels for this product
$products_discounts_query = $db->Execute("select * from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " where products_id='" . (int)$products_id_current . "' and discount_qty !=0 " . " order by discount_qty");