Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

So I made the changes to the three instances, and it does not work.
Interesting, just cut and pasted that into a file, added the three [$x] and it works fine (except the quantity is not taken into account, I assume you had to make changes in application_top.php for that).
I am also getting an error in the admin section on all the links in the left columns headings. Nothing will engage.
Often that error is caused by uploading the "code" file to the language folder. Then it is included twice, but also application_top is tried to be included twice, which causes that error.
Link to comment
Share on other sites

Interesting, just cut and pasted that into a file, added the three [$x] and it works fine (except the quantity is not taken into account, I assume you had to make changes in application_top.php for that).

Often that error is caused by uploading the "code" file to the language folder. Then it is included twice, but also application_top is tried to be included twice, which causes that error.

 

Yest, the changes where made for the contribution Add Quantity to Product Listing.

Here is the changed file application_top.php.

 

<?php

/*

$Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// start the timer for the page parse time log

define('PAGE_PARSE_START_TIME', microtime());

 

// set the level of error reporting

error_reporting(E_ALL & ~E_NOTICE);

 

// check if register_globals is enabled.

// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.

if (function_exists('ini_get')) {

ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');

}

 

// Set the local configuration parameters - mainly for developers

if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

 

// include server parameters

require('includes/configure.php');

 

if (strlen(DB_SERVER) < 1) {

if (is_dir('install')) {

header('Location: install/index.php');

}

}

 

// define the project version

define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

 

// set the type of request (secure or not)

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

 

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

 

if ($request_type == 'NONSSL') {

define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);

} else {

define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);

}

 

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

 

// include the list of project database tables

require(DIR_WS_INCLUDES . 'database_tables.php');

 

// customization for the design layout

define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

 

// include the database functions

require(DIR_WS_FUNCTIONS . 'database.php');

 

// make a connection to the database... now

tep_db_connect() or die('Unable to connect to database server!');

 

// set the application parameters

$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

while ($configuration = tep_db_fetch_array($configuration_query)) {

define($configuration['cfgKey'], $configuration['cfgValue']);

}

 

// if gzip_compression is enabled, start to buffer the output

if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {

if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {

if (PHP_VERSION >= '4.0.4') {

ob_start('ob_gzhandler');

} else {

include(DIR_WS_FUNCTIONS . 'gzip_compression.php');

ob_start();

ob_implicit_flush();

}

} else {

ini_set('zlib.output_compression_level', GZIP_LEVEL);

}

}

 

// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled

if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {

if (strlen(getenv('PATH_INFO')) > 1) {

$GET_array = array();

$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);

$vars = explode('/', substr(getenv('PATH_INFO'), 1));

for ($i=0, $n=sizeof($vars); $i<$n; $i++) {

if (strpos($vars[$i], '[]')) {

$GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];

} else {

$HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];

}

$i++;

}

 

if (sizeof($GET_array) > 0) {

while (list($key, $value) = each($GET_array)) {

$HTTP_GET_VARS[$key] = $value;

}

}

}

}

 

// define general functions used application-wide

require(DIR_WS_FUNCTIONS . 'general.php');

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

// set the cookie domain

$cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);

$cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);

 

// include cache functions if enabled

if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

// begin PayPal_Shopping_Cart_IPN

require(DIR_WS_MODULES . 'payment/paypal/classes/osC/osC.class.php');

// end PayPal_Shopping_Cart_IPN

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.php');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// check if sessions are supported, otherwise use the php3 compatible session class

if (!function_exists('session_start')) {

define('PHP_SESSION_NAME', 'osCsid');

define('PHP_SESSION_PATH', $cookie_path);

define('PHP_SESSION_DOMAIN', $cookie_domain);

define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

 

include(DIR_WS_CLASSES . 'sessions.php');

}

 

// define how the session functions will be used

require(DIR_WS_FUNCTIONS . 'sessions.php');

 

// set the session name and save path

tep_session_name('osCsid');

tep_session_save_path(SESSION_WRITE_DIRECTORY);

 

// set the session cookie parameters

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, $cookie_path, $cookie_domain);

} elseif (function_exists('ini_set')) {

ini_set('session.cookie_lifetime', '0');

ini_set('session.cookie_path', $cookie_path);

ini_set('session.cookie_domain', $cookie_domain);

}

 

//pdf data-sheet

define('FILENAME_PDF_DATASHEET', 'pdf_datasheet.php');

 

// set the session ID if it exists

if (isset($HTTP_POST_VARS[tep_session_name()])) {

tep_session_id($HTTP_POST_VARS[tep_session_name()]);

} elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {

tep_session_id($HTTP_GET_VARS[tep_session_name()]);

}

 

// start the session

$session_started = false;

if (SESSION_FORCE_COOKIE_USE == 'True') {

tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);

 

if (isset($HTTP_COOKIE_VARS['cookie_test'])) {

tep_session_start();

$session_started = true;

}

} elseif (SESSION_BLOCK_SPIDERS == 'True') {

$user_agent = strtolower(getenv('HTTP_USER_AGENT'));

$spider_flag = false;

 

if (tep_not_null($user_agent)) {

$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

 

for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {

if (tep_not_null($spiders[$i])) {

if (is_integer(strpos($user_agent, trim($spiders[$i])))) {

$spider_flag = true;

break;

}

}

}

}

 

if ($spider_flag == false) {

tep_session_start();

$session_started = true;

}

} else {

tep_session_start();

$session_started = true;

}

 

// set SID once, even if empty

$SID = (defined('SID') ? SID : '');

 

// verify the ssl_session_id if the feature is enabled

if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {

$ssl_session_id = getenv('SSL_SESSION_ID');

if (!tep_session_is_registered('SSL_SESSION_ID')) {

$SESSION_SSL_ID = $ssl_session_id;

tep_session_register('SESSION_SSL_ID');

}

 

if ($SESSION_SSL_ID != $ssl_session_id) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_SSL_CHECK));

}

}

 

// verify the browser user agent if the feature is enabled

if (SESSION_CHECK_USER_AGENT == 'True') {

$http_user_agent = getenv('HTTP_USER_AGENT');

if (!tep_session_is_registered('SESSION_USER_AGENT')) {

$SESSION_USER_AGENT = $http_user_agent;

tep_session_register('SESSION_USER_AGENT');

}

 

if ($SESSION_USER_AGENT != $http_user_agent) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

}

 

// verify the IP address if the feature is enabled

if (SESSION_CHECK_IP_ADDRESS == 'True') {

$ip_address = tep_get_ip_address();

if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {

$SESSION_IP_ADDRESS = $ip_address;

tep_session_register('SESSION_IP_ADDRESS');

}

 

if ($SESSION_IP_ADDRESS != $ip_address) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

}

 

// 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);

}

 

// begin PayPal_Shopping_Cart_IPN

PayPal_osC::check_order_status(true);

// end PayPal_Shopping_Cart_IPN

 

 

} else {

tep_session_register('cart');

$cart = new shoppingCart;

}

 

// include currencies class and create an instance

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

// include the mail classes

require(DIR_WS_CLASSES . 'mime.php');

require(DIR_WS_CLASSES . 'email.php');

 

// set the language

if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

if (!tep_session_is_registered('language')) {

tep_session_register('language');

tep_session_register('languages_id');

}

 

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {

$lng->set_language($HTTP_GET_VARS['language']);

} else {

$lng->get_browser_language();

}

 

$language = $lng->language['directory'];

$languages_id = $lng->language['id'];

}

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

 

// currency

if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {

if (!tep_session_is_registered('currency')) tep_session_register('currency');

 

if (isset($HTTP_GET_VARS['currency'])) {

if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

} else {

$currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

}

}

 

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

} else {

tep_session_register('navigation');

$navigation = new navigationHistory;

}

$navigation->add_current_page();

 

// Shopping cart actions

if (isset($HTTP_GET_VARS['action'])) {

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

if ($session_started == false) {

tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

}

 

if (DISPLAY_CART == 'true') {

$goto = FILENAME_SHOPPING_CART;

$parameters = array('action', 'cPath', 'products_id', 'pid');

} else {

$goto = basename($PHP_SELF);

if ($HTTP_GET_VARS['action'] == 'buy_now') {

$parameters = array('action', 'pid', 'products_id');

} else {

$parameters = array('action', 'pid');

}

}

switch ($HTTP_GET_VARS['action']) {

// customer wants to update the product quantity in their shopping cart

case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {

if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {

$cart->remove($HTTP_POST_VARS['products_id'][$i]);

} else {

if (PHP_VERSION < 4) {

// if PHP3, make correction for lack of multidimensional array.

reset($HTTP_POST_VARS);

while (list($key, $value) = each($HTTP_POST_VARS)) {

if (is_array($value)) {

while (list($key2, $value2) = each($value)) {

if (ereg ("(.*)\]\[(.*)", $key2, $var)) {

$id2[$var[1]][$var[2]] = $value2;

}

}

}

}

$attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';

} else {

$attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';

}

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$quantity, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// performed by the 'buy now' button in product listings and review page

case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

} else {

$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

case 'notify' : if (tep_session_is_registered('customer_id')) {

if (isset($HTTP_GET_VARS['products_id'])) {

$notify = $HTTP_GET_VARS['products_id'];

} elseif (isset($HTTP_GET_VARS['notify'])) {

$notify = $HTTP_GET_VARS['notify'];

} elseif (isset($HTTP_POST_VARS['notify'])) {

$notify = $HTTP_POST_VARS['notify'];

} else {

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

}

if (!is_array($notify)) $notify = array($notify);

for ($i=0, $n=sizeof($notify); $i<$n; $i++) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] < 1) {

tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");

}

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] > 0) {

tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));

} else {

$cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

}

}

 

// include the who's online functions

require(DIR_WS_FUNCTIONS . 'whos_online.php');

tep_update_whos_online();

 

// include the password crypto functions

require(DIR_WS_FUNCTIONS . 'password_funcs.php');

 

// include validation functions (right now only email address)

require(DIR_WS_FUNCTIONS . 'validations.php');

 

// split-page-results

require(DIR_WS_CLASSES . 'split_page_results.php');

 

// infobox

require(DIR_WS_CLASSES . 'boxes.php');

 

// auto activate and expire banners

require(DIR_WS_FUNCTIONS . 'banner.php');

tep_activate_banners();

tep_expire_banners();

 

// auto expire special products

require(DIR_WS_FUNCTIONS . 'specials.php');

tep_expire_specials();

 

// calculate category path

if (isset($HTTP_GET_VARS['cPath'])) {

$cPath = $HTTP_GET_VARS['cPath'];

} elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {

$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);

} else {

$cPath = '';

}

 

if (tep_not_null($cPath)) {

$cPath_array = tep_parse_category_path($cPath);

$cPath = implode('_', $cPath_array);

$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];

} else {

$current_category_id = 0;

}

 

// include the breadcrumb class and start the breadcrumb trail

require(DIR_WS_CLASSES . 'breadcrumb.php');

$breadcrumb = new breadcrumb;

 

$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

$breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

 

// add category names or the manufacturer name to the breadcrumb trail

if (isset($cPath_array)) {

for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {

$categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($categories_query) > 0) {

$categories = tep_db_fetch_array($categories_query);

$breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));

} else {

break;

}

}

} elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {

$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

if (tep_db_num_rows($manufacturers_query)) {

$manufacturers = tep_db_fetch_array($manufacturers_query);

$breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));

}

}

 

// add the products model to the breadcrumb trail

if (isset($HTTP_GET_VARS['products_id'])) {

$model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

if (tep_db_num_rows($model_query)) {

$model = tep_db_fetch_array($model_query);

$breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));

}

}

 

// initialize the message stack for output messages

require(DIR_WS_CLASSES . 'message_stack.php');

$messageStack = new messageStack;

 

// set which precautions should be checked

define('WARN_INSTALL_EXISTENCE', 'true');

define('WARN_CONFIG_WRITEABLE', 'true');

define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');

define('WARN_SESSION_AUTO_START', 'true');

define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');

?>

 

I will look for the duplicated code in the language file. Which code do I look for in particular?

(Sorry for the stupid question but I have not had very much sleep. 4 hours a night for 2 months working on this and learning.)

Thanks for your help.

(I may need to hire you to bail me out of this problem.)

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Yest, the changes where made for the contribution Add Quantity to Product Listing.

Here is the changed file application_top.php.

Hmm, not crazy about this part:

// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$quantity, $HTTP_POST_VARS['id']);
}

I have seen it done better ($quantity should really be the post variable):

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']);
}

I will look for the duplicated code in the language file. Which code do I look for in particular?
Check the files in admin/includes/languages/english/ to see if they are really language files (mostly only defines for the "code" file, start with the newest ones).
Link to comment
Share on other sites

Hmm, not crazy about this part:

// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$quantity, $HTTP_POST_VARS['id']);
}

I have seen it done better ($quantity should really be the post variable):

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']);
}

Check the files in admin/includes/languages/english/ to see if they are really language files (mostly only defines for the "code" file, start with the newest ones).

 

 

Ok, I'll post the results in the middle of the night. Thanks.

Parents just arrived.

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Ok, I'll post the results in the middle of the night.
I don't know if this is a problem for Ontario but at least for some Canadians you will have the problem that for companies buying from you cannot make them tax_exempt because there is one tax they do have to pay. There is a mod for that which has still not been added to the contribution to make it possible to make specific taxes exempt. I can put it somewhere for download if the need arises.
Link to comment
Share on other sites

Is there anyway to modify it so the Specials work for other Customer Groups besides the Retail group? What I am looking at is if I a Customer Group has a standard price break of say 20% with 2+ items ordered, 30% with 5+ ordered, 40% for 10+ items, but for some reason I use the regular Special feature to make a 40% for everybody, it would be nice that the other Customer Group picks up on the special price for all orders up to 1-9 items. Then when the Special is over, everything would revert back to the Customer Group's usual percentage discount.
I'm afraid this would need to so many changes to the code that it would take a long time to compensate for even changing the code using instructions compared to the time it takes to enter the special price for that item for the different customer groups.
Link to comment
Share on other sites

I don't know if this is a problem for Ontario but at least for some Canadians you will have the problem that for companies buying from you cannot make them tax_exempt because there is one tax they do have to pay. There is a mod for that which has still not been added to the contribution to make it possible to make specific taxes exempt. I can put it somewhere for download if the need arises.

 

I am glad you brought that up. I will require something to adjust for that. Let me know if I can get it.

 

No time right now to view the languages code yet, but will post on it very very soon.(Company here)

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Hi!

 

Thanks for a wonderful contribution!

 

I have added SPPC 4.13 and Quantity Price Breaks for Separate Pricing Per Customer on a shop with some twenty other contributions already in it. To my surprice it seems to work nicely.

 

Now I'd like to add Hide products from customer groups for SPPC as well.

 

I guess it is possible to do that, right?!

 

If so - what do I need to be aware of, what is the best way of doing it etc?

Link to comment
Share on other sites

Found another one on my hard disk this evening. I tested this one and at least it doesn't give errors.

 

 

omitted

 

Yes, and they work fine with me (and most other people I guess since I don't recall any complaints about it). Did you try the one from the package?

 

 

Thanks JanZ that worked... sorta. when i log in (and i am wholesale) i see retail price on the items within the featured products box... but if i click on them or on the "featured products" link... i see the correct wholesale prices...

 

is there anyway to make the contents of the box on the main page display wholesale as well??? also i had to modify that last file you gave to make it work with the "cool menus" contib... but the changes i made are not related to this remaining issue...

 

still havn't figured out the deal with my "broken sorting arrows", it should put test in alphabetical order correct and numbers sort numerically correct?? well when i click the arrows the page refreshes but order doesnt change on anything...

 

my retail customer group is "1" and wholesale is "2" does that matter?? seems like i read you saying that retail should always be "0"??? it is possible that i broke the sorting feature when installing contribs or something... but i am not sure which file the "sorting code" resides in...

 

anywayz thanks for the help

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Chris,

Now I'd like to add Hide products from customer groups for SPPC as well.

 

I guess it is possible to do that, right?!

Have never tried that, but a cursory scan (getting late here for me) makes me think that the Price Formatter and Hide products are probably not going to interfere which each other (at least not often ;) ) In principle they should live with each other.
Link to comment
Share on other sites

is there anyway to make the contents of the box on the main page display wholesale as well???
Has been done.

 

still havn't figured out the deal with my "broken sorting arrows", it should put test in alphabetical order correct and numbers sort numerically correct?? well when i click the arrows the page refreshes but order doesnt change on anything...
Strange.
my retail customer group is "1" and wholesale is "2" does that matter?? seems like i read you saying that retail should always be "0"???
Yes, retail should be 0, no way around that. If the customer is not logged in, he/she is assumed to be customers_group_id 0, the retail group. I don't think it has to do with the sorting issue though.

 

The sorting is done by the queries. They can all be found near the end of the file customers.php:

		  <?php  // BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
	  switch ($listing) {
		  case "id-asc":
		  $order = "c.customers_id";
		  break;
		  case "cg_name":
		  $order = "cg.customers_group_name, c.customers_lastname";
		  break;
		  case "cg_name-desc":
		  $order = "cg.customers_group_name DESC, c.customers_lastname";
		  break;
		  case "firstname":
		  $order = "c.customers_firstname";
		  break;
		  case "firstname-desc":
		  $order = "c.customers_firstname DESC";
		  break;
		  case "company":
		  $order = "a.entry_company, c.customers_lastname";
		  break;
		  case "company-desc":
		  $order = "a.entry_company DESC,c .customers_lastname DESC";
		  break;
		  case "ra":
		  $order = "c.customers_group_ra DESC, c.customers_id DESC";
		  break;
		  case "ra-desc":
		  $order = "c.customers_group_ra, c.customers_id DESC";
		  break;
		  case "lastname":
		  $order = "c.customers_lastname, c.customers_firstname";
		  break;
		  case "lastname-desc":
		  $order = "c.customers_lastname DESC, c.customers_firstname";
		  break;
		  default:
		  $order = "c.customers_id DESC";
	  }
	  ?>
..
..
..
// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_id, c.customers_group_ra, a.entry_country_id, a.entry_company, cg.customers_group_name from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join " . TABLE_CUSTOMERS_GROUPS . " cg on c.customers_group_id = cg.customers_group_id " . $search . " order by $order";
// c.customers_lastname, c.customers_firstname";
// EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer

Link to comment
Share on other sites

Has been done.

 

Strange.

Yes, retail should be 0, no way around that. If the customer is not logged in, he/she is assumed to be customers_group_id 0, the retail group. I don't think it has to do with the sorting issue though.

 

The sorting is done by the queries. They can all be found near the end of the file customers.php:

omitted

Thanks for the link to the modified "feature.php" file... that worked perfectly!!! :)

i think my "customers.php" file has some problems near the end where the sorting occurs, i will just post the relevant part... it looks like i have multiple code instances??? the code i posted below starts with the first instance of "// BOF customer_sort_admin_v1... " im having trouble deciding what to cut and replace with the code you posted... help!

 

(i have not applied what you posted for the end part yet...)

		  <?php  // BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
	  switch ($listing) {
		  case "id-asc":
		  $order = "c.customers_id";
		  break;
		  case "cg_name":
		  $order = "cg.customers_group_name, c.customers_lastname";
		  break;
		  case "cg_name-desc":
		  $order = "cg.customers_group_name DESC, c.customers_lastname";
		  break;
		  case "firstname":
		  $order = "c.customers_firstname";
		  break;
		  case "firstname-desc":
		  $order = "c.customers_firstname DESC";
		  break;
		  case "company":
		  $order = "a.entry_company, c.customers_lastname";
		  break;
		  case "company-desc":
		  $order = "a.entry_company DESC,c .customers_lastname DESC";
		  break;
		  case "ra":
		  $order = "c.customers_group_ra DESC, c.customers_id DESC";
		  break;
		  case "ra-desc":
		  $order = "c.customers_group_ra, c.customers_id DESC";
		  break;
		  case "lastname":
		  $order = "c.customers_lastname, c.customers_firstname";
		  break;
		  case "lastname-desc":
		  $order = "c.customers_lastname DESC, c.customers_firstname";
		  break;
		  default:
		  $order = "c.customers_id DESC";
	  }
	  ?>
		 <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr class="dataTableHeadingRow">
			<td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=company"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . ENTRY_COMPANY . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=company-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . ENTRY_COMPANY . ' --> Z-X-Y From Top '); ?></a><br><?php echo ENTRY_COMPANY; ?></td>
			<td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=lastname"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_LASTNAME . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=lastname-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_LASTNAME . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_LASTNAME; ?></td>
			<td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=firstname"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_FIRSTNAME . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=firstname-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_FIRSTNAME . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
	<td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=cg_name"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_CUSTOMERS_GROUPS . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=cg_name-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_CUSTOMERS_GROUPS . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_CUSTOMERS_GROUPS; ?></td>
			<td class="dataTableHeadingContent" align="right" valign="top"><a href="<?php echo "$PHP_SELF?listing=id-asc"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_ACCOUNT_CREATED . ' --> 1-2-3 From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=id-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_ACCOUNT_CREATED . ' --> 3-2-1 From Top '); ?></a><br><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?>
							</td><td class="dataTableHeadingContent" align="middle" valign="top"><a href="<?php echo "$PHP_SELF?listing=ra"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_REQUEST_AUTHENTICATION . ' --> RA first (to Top) '); ?></a> <a href="<?php echo "$PHP_SELF?listing=ra-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_REQUEST_AUTHENTICATION . ' --> RA last (to Bottom)'); ?></a><br><?php echo TABLE_HEADING_REQUEST_AUTHENTICATION; ?> </td>
			</td><td class="dataTableHeadingContent" align="right" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '11', '12'); ?> <br><?php echo TABLE_HEADING_ACTION; ?> </td>
		  </tr>	 
<?php  // EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
$search = '';
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
  $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
 // $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
 $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
}
// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_id, c.customers_group_ra, a.entry_country_id, a.entry_company, cg.customers_group_name from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join customers_groups cg on c.customers_group_id = cg.customers_group_id " . $search . " order by $order";
// c.customers_lastname, c.customers_firstname";
// EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
$customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
$customers_query = tep_db_query($customers_query_raw);
while ($customers = tep_db_fetch_array($customers_query)) {
  $info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");
  $info = tep_db_fetch_array($info_query);

  if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $customers['customers_id']))) && !isset($cInfo)) {
	$country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$customers['entry_country_id'] . "'");
	$country = tep_db_fetch_array($country_query);

	$reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers['customers_id'] . "'");
	$reviews = tep_db_fetch_array($reviews_query);

	$customer_info = array_merge($country, $info, $reviews);

	$cInfo_array = array_merge($customers, $customer_info);
	$cInfo = new objectInfo($cInfo_array);
  }

  if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) {
	echo '		  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";
  } else {
	echo '		  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";
  }
// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer ?>
			<td class="dataTableContent"><?php
			if (strlen($customers['entry_company']) > 16 ) {
		 print ("<acronym title=\"".$customers['entry_company']."\">".substr($customers['entry_company'], 0, 16)." </acronym>");
		 } else {
			echo $customers['entry_company']; } ?></td>
			<td class="dataTableContent"><?php 
			if (strlen($customers['customers_lastname']) > 15 ) {
		 print ("<acronym title=\"".$customers['customers_lastname']."\">".substr($customers['customers_lastname'], 0, 15)." </acronym>");
		 } else {
			echo $customers['customers_lastname']; } ?></td>
			<td class="dataTableContent"><?php
			if (strlen($customers['customers_firstname']) > 15 ) {
		 print ("<acronym title=\"".$customers['customers_firstname']."\">".substr($customers['customers_firstname'], 0, 15)." </acronym>");
		 } else {
		echo $customers['customers_firstname']; } ?></td>
	<td class="dataTableContent"><?php
			if (strlen($customers['customers_group_name']) > 17 ) {
		 print ("<acronym title=\"".$customers['customers_group_name']."\"> ".substr($customers['customers_group_name'], 0, 17)." </acronym>");
		 } else {
			echo $customers['customers_group_name'];
			}  
// EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer ?></td> 
			<td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>
			<td  class="dataTableContent" align="middle">
<?php
  if ($customers['customers_group_ra'] == '1') {
	echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_GREEN, 10, 10);
	} else {
	echo tep_draw_separator('pixel_trans.gif', '10', '10'); 
	} ?></td>
			<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
		  </tr>
<?php
}
?>
		  <tr><!-- BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer colspan 4 to 7 -->
			<td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<!-- EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer -->
			  <tr>
				<td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
				<td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
			  </tr>
<?php
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
?>
			  <tr>
				<td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
			  </tr>
<?php
}
?>
			</table></td>
		  </tr>
<!-- BOF Separate Pricing Per Customer: show numbers of customers in each customers group -->
<?php
  if (!isset($HTTP_GET_VARS['search'])) {
  $customers_groups_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
  while ($existing_customers_groups =  tep_db_fetch_array($customers_groups_query)) {
  $existing_customers_groups_array[] = array("id" => $existing_customers_groups['customers_group_id'], "text" => $existing_customers_groups['customers_group_name']);
  }
  $count_groups_query = tep_db_query("select customers_group_id, count(*) as count from " . TABLE_CUSTOMERS . " group by customers_group_id order by count desc");
  while ($count_groups = tep_db_fetch_array($count_groups_query)) {
for ($n = 0; $n < sizeof($existing_customers_groups_array); $n++) {
	if ($count_groups['customers_group_id'] == $existing_customers_groups_array[$n]['id']) {
		$count_groups['customers_group_name'] = $existing_customers_groups_array[$n]['text'];
	}
} // end for ($n = 0; $n < sizeof($existing_customers_groups_array); $n++)
$count_groups_array[] = array("id" => $count_groups['customers_group_id'], "number_in_group" => $count_groups['count'], "name" => $count_groups['customers_group_name']); 
  }
?>
		  <tr>
		 <td style="padding-top: 10px;" align="center" colspan="7"><table border="0" cellspacing="0" cellpadding="2" style="border: 1px solid #c9c9c9">
	 <tr class="dataTableHeadingRow">
	 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS_GROUPS ?></td>
	 <td class="dataTableHeadingContent"> </td>
	 <td class="dataTableHeadingContent" align="right">No.</td>
	 </tr>
<?php $c = '0'; // variable used for background coloring of rows
  for ($z = 0; $z < sizeof($count_groups_array); $z++) { 
  $bgcolor = ($c++ & 1) ? ' class="dataTableRow"' : ''; 
   ?>
	 <tr<?php echo $bgcolor; ?>>
	 <td class="dataTableContent"><?php echo $count_groups_array[$z]['name']; ?></td>
	 <td class="dataTableContent"> </td>
	 <td class="dataTableContent" align="right"><?php echo $count_groups_array[$z]['number_in_group'] ?></td>
	 </tr>
<?php 
  } // end for ($z = 0; $z < sizeof($count_groups_array); $z++) 
?>		 </table>
	 </td>
		  <tr>
<?php
 } // end if (!isset($HTTP_GET_VARS['search']))
?>
<!-- EOF Separate Pricing Per Customer: show numbers of customers in each customers group -->
		</table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
case 'confirm':
// BOF Separate Pricing Per Customer: dark grey field with customer name higher
  $heading[] = array('text' => ''. tep_draw_separator('pixel_trans.gif', '11', '12') .' <br><b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');
// EOF Separate Pricing Per Customer
  $contents = array('form' => tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));
  $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
  if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));
  $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  break;
default:
  if (isset($cInfo) && is_object($cInfo)) { 
// BOF Separate Pricing Per Customer: dark grey field with customer name higher
	$heading[] = array('text' => ''. tep_draw_separator('pixel_trans.gif', '11', '12') .' <br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
// EOF Separate Pricing Per Customer
	$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . '</a> <a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
	$contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($cInfo->date_account_created));
	$contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->date_account_last_modified));
	$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_LAST_LOGON . ' '  . tep_date_short($cInfo->date_last_logon));
	$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons);
	$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name);
	$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews);
  }
  break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo '			<td width="25%" valign="top">' . "\n";

$box = new box;
echo $box->infoBox($heading, $contents);

echo '			</td>' . "\n";
 }
?>
	  </tr>
	</table></td>
  </tr>
<?php
 }
?>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

ok... i figured out what to replace... but it still doesn't work!!! and now that i have replaced what you posted... it looks the same as it did before... i dont know where the problem is...

 

my customer groups were correct as well btw...

retail = 0

wholesale = 1

 

i checked it in phpmyadmin

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Also... is there a way to PREVENT specific products of my choosing from showing up in the "Customers who purchased this also purchased:" box???

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

ok... i figured out what to replace... but it still doesn't work!!! and now that i have replaced what you posted... it looks the same as it did before... i dont know where the problem is...
Me neither since when I cut and paste what you posted in my file it works fine. Shot in the dark: might be a register global effect. In the first few lines it says:
switch ($listing) {

where $listing is actually the GET variable listing (the one that is passed in the url: e.g. listing=company). Perhaps if you use:

switch ($_GET['listing']) {

it works.

Link to comment
Share on other sites

...So I loaded up SPPC on the old backup and it seems to work fine, including the Add to Cart Buttons in Product listing. I now have 12 more contributions to install to get back to where I was. This one is the biggest. Next is the taxes mod you directed me to earlier.

 

Also: I can't remember how to have both the retail price and the special price show in the product listing. Can I be directed to the proper post?

 

Thanks again for the incredible support on this contribution.

Rod

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

you sure that was a shot in the dark?? cuz it WORKED!!

i thought i had worked out all of the register global dependencies... i guess not

thanks man!!

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

ok in the "catalog/products" section of the admin page, i need the existing items to be listed by model...

 

currently it only list them by name, like so:

 

prodcategories.gif

 

i want to have an additional column called "model" that list them by the "model" number (item number) that i put in when i created each item...

 

how can i do this?

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

ok in the "catalog/products" section of the admin page, i need the existing items to be listed by model...

 

currently it only list them by name, like so:

 

prodcategories.gif

 

i want to have an additional column called "model" that list them by the "model" number (item number) that i put in when i created each item...

 

how can i do this?

 

Herot,

 

This has little/nothing to do w/ SPPC and will cause no conlfict whatsoever with the SPPC contribution. I have done it on each of my 3 sites.

 

This topic has been asked in the past (countless times) in the "General Support" forum and I belive there is a how-to in the "Tips and Tricks" area. Or you can search the contributions, which I have done for you, to find yet the same answer -- http://www.oscommerce.com/community/contributions,938

 

Jan does a great job keeping this thread supported, IMHO we should not bug it down with gneral osc questions.

 

Nate

Link to comment
Share on other sites

Hi,

 

Just got this contrib installed in a fresh osc. From what i've read so far is that one must register as 'wholesale' to see the wholesale price. Is there a way of displaying both the price without the need to register ? or something like an option where the visitor can choose which price to display(wholesale or retail).. :rolleyes:

 

Thx in advance

Link to comment
Share on other sites

Also... is there a way to PREVENT specific products of my choosing from showing up in the "Customers who purchased this also purchased:" box???
Not exactly SPPC related, but you could write the product id's to a comma separated list and save them as a text file. Then read in that file and either use it directly in the query or first clean it up (see this post which gives the code for reading the file and cleaning it up) and then "implode" the array again to a comma separated string.

 

Then find the query for the also purchased box and then add something to it in the effect of: "AND products_id NOT IN ($comma_separated_list)"

Link to comment
Share on other sites

Is there a way of displaying both the price without the need to register ? or something like an option where the visitor can choose which price to display(wholesale or retail)..
This is probably the last thing anyone would like to show their retail customers but I guess you have your reasons.

 

On the product_info.php page you can find the query for the customer group price (changed it here):

// BOF Separate Price per Customer
 $product_info['wholesale_price'] = '';
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '1' ");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	$product_info['wholesale_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer

You probably would do best to use a regular product_info.php page (not the SPPC one) and add that query for pick up the wholesale price (provide the correct customer_group_id in the query, like '1') and echo it somewhere.

Link to comment
Share on other sites

I have just undertaken the most satisfying hour or so of my experience with osCommerce, manually installing this contribution on an osCommerce site I inherited via my new boss!

 

The site is already modified and has a few contributions installed already, which leads me to make this post .... it would appear (and I'm only guessing) that I need some expert help to manually edit the includes/classes/shopping_cart.php and catalog/product_info.php files - they are the only files I cannot edit, and I believe its to do with a contribution already installed (again at a guess the Price Breaks contrib).

 

Has anyone had a similar problem please? Should I just post the code in this thread or if someone can help I can email a zip with the two files and the edits required.

 

Help! I'm so close and yet so far.

 

Thanks in advance.

Allan Young

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...