Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

PS - I also need to set it up so that the only way a wholesaler gets a customer account as a wholesaler is if we give it to them. I am not sure how people sign up to be a wholesaler right now in the system - but my guess would be if they put in their tax ID the system automatically gives them wholesaler status. We don't want to have the system do this automatically. Any ideas on how to set it up so people creating their membership don't get to be wholesalers unless we say it's ok?

 

Thanks again,

Tracy

~Tracy
 

Link to comment
Share on other sites

looks like a great contrib, and the docs/images give a good feel for functionality prior to install - thanks to all those involved. :thumbsup:

 

any comments on what's the most recent, yet stable, complete install? all the way back to v4.1, there's a folder that says "upgrade_from_40_to_version_41" - does this mean i need to install the 4.0 version first and then apply the bug fixes individually?

 

thanks.

 

p.s. - tried scrolling back a few pages to research for myself, but the board is so slow right now that it's literally taking 5-10 minutes for the pages to load.

Link to comment
Share on other sites

PS - I also need to set it up so that the only way a wholesaler gets a customer account as a wholesaler is if we give it to them. I am not sure how people sign up to be a wholesaler right now in the system - but my guess would be if they put in their tax ID the system automatically gives them wholesaler status. We don't want to have the system do this automatically. Any ideas on how to set it up so people creating their membership don't get to be wholesalers unless we say it's ok?

 

Thanks again,

Tracy

~Tracy
 

Link to comment
Share on other sites

PS - I also need to set it up so that the only way a wholesaler gets a customer account as a wholesaler is if we give it to them. I am not sure how people sign up to be a wholesaler right now in the system - but my guess would be if they put in their tax ID the system automatically gives them wholesaler status. We don't want to have the system do this automatically. Any ideas on how to set it up so people creating their membership don't get to be wholesalers unless we say it's ok?

 

Thanks again,

Tracy

 

RE: the error, what php/MySql version are you using?

 

SPPC: You 1st need to insert/add a few customer groups under admin -> customer -> customer group, eg, retails, wholesales, loyalCustomer etc; after customers sign up, you then go to admin to asign them to a group, by default, it's retails.

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Should not give those problems.

Yes, indeed. You did download and install the latest version? In the older version you could only hide the individual products.

 

hi janz,

 

i have done a fresh install of os, with sppc and hiding products, it all works fine, if i hide a category it hides everythign in that category also which is great.

 

However i am still getting the problem with my product attribute options, eg: i have a soccerball size 3,4,5 retailat $50, i have set the whole for this product to $30.

 

retail user sees correct price, no problem there, however my wholesale customer sees $30 in the heading , but in the size drop down box the price is still $50 for each of the sizes, like it has set a wholesale on the product in general but not on the particular sizes that it is available in , plus i dont see an option in product attributes in admin to set a wholesale price for sizes and colors.

 

no doubt there might be an easy way to fix this with the query it is using to get the options price ( must not contact a customer_id to group ID check or something) however im not great with php nor sql and have no idea where to start, i would imagine it would be somewhere around here in product_info.php

 

<?php

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

$products_attributes = tep_db_fetch_array($products_attributes_query);

if ($products_attributes['total'] > 0) {

?>

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>

</tr>

<?php

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

$products_options_array = array();

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

</tr>

<?php

}

?>

</table>

 

 

 

if anybody has this working for them or knows if i am doing anything wrong any help would be appreciated !! obviosuly this renders SPPC pretty useless to me if i can only do it to products without product attributes set.

Link to comment
Share on other sites

actually now that i realise it, this is where i am getting a adding wholesale price and retail price problem.

 

If i have an item with no attributes (sizes colors etc:) the item displays correct amount, adds to the cart correctly and i have no problems, however when an item has attributes, it displays whole pricing in the heading, retail pricing in the size drop down and when i add an item to the cart it adds wholesale pricing and retail pricing together !!!

 

resulting in a $50 retail item, and $30 wholesale item (when logged in as wholesale) adding to the cart for $80 ?!?!

Link to comment
Share on other sites

Forum seems to be loading a bit faster this evening, so spent the past few hours getting through this 142 page thread. :P Did you know that the thread is so large that only about 1/3 of it will format for printing or file saving??? JanZ, kudos for an incredible effort at keeping this contrib well supported! Just as impressed by how many "complimentary" modules have been added, thanks for all the hard work. :thumbsup:

 

Have been looking [extensively] for a stable, supported contribution that can be used to keep my shop in compliance with supplier MAP (minimum-advertised-pricing) policy. Excited that I may have finally found a solution. What I'm hoping to do has been previously discussed, with the best example listed here. However, despite considerable searching, I haven't been able to find step-by-step instructions for making this happen.

 

Basically, no one with an account should pay "retail" advertised pricing (i.e., all users auto to level 2 pricing upon sign-up), but I don't want to be involved in the approval process unless the user requests level 3 pricing or higher. Seems like this may be something slated for release v4.20 (around p131), and if so, please advise cuz I'll happily sit tight and wait. :D

Link to comment
Share on other sites

Hi All!

I'm finished with the upgrade from Hide products and categories 1.03 to 2.01.

It seems to work very well with one small exeption.

I have a categories-box contribution installed called Dynamenu.

The "tep_db_query" in Dynamenu:

$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, cd.categories_name');

The hide products "tep_db_query":

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by sort_order, cd.categories_name");

I thought it looked easy so I have tried several times to edit the Dynamenu query to work with Hide 2.01, but I think I need help!

//Micke

Link to comment
Share on other sites

Hi All!

Regarding the previous post about the SPPC/Hide Products and Categories/Dynamenu query...

 

What's wrong with this one:

$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id="' . (int)$languages_id .'" and find_in_set("' . $customer_group_id . '", categories_hide_from_groups) = 0 order by sort_order, cd.categories_name');

...the menu still renders the hidden categories...

//Micke

Link to comment
Share on other sites

Hi All!

The reason I could not find what was wrong in the query was that the problem was elsewhere...

$customer_group_id has to be added to the globals on line 211 and 213 in catalog/includes/boxes/dm_categories.php

// Create the root category list
function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){

global $cPath_array, $show_full_tree, $languages_id, $customer_group_id; 

global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id, $customer_group_id;

Greetings and regards,

//Micke

Link to comment
Share on other sites

Hi all

I was wondering if you can help me. I installed SPPC 415, and when accessing the webpage, it shows an error refered to an undefined function in catalog/includes/classes/shopping_cart.php. The function is serialize().

I commented these lines in order to avoid the error, but then i find the follwing:

Fatal error: Call to undefined function: get_products() in (..)web/includes/boxes/shopping_cart.php on line 25

This file is not modified by SPPC, so i think the problem is with the first one.

I have already revised the file, but it's ok.

 

Any idea?

Thanks in advance

Link to comment
Share on other sites

RE: the error, what php/MySql version are you using?

 

SPPC: You 1st need to insert/add a few customer groups under admin -> customer -> customer group, eg, retails, wholesales, loyalCustomer etc; after customers sign up, you then go to admin to asign them to a group, by default, it's retails.

 

Ken

 

 

Thanks Ken - I am happy to hear that it automatically sets them to default unless we go in and change their status :D

 

As for the PHP/MySQL versions - Here is what my store says from the tools menu:

 

PHP Version: 4.4.2 (Zend: 1.3.0)

Database: MySQL 5.0.24a-standard-log

 

I did go back and re-merge the index page (for the umpteenth time now - LOL) and I am getting closer. I do at least get the product table now - but each column contains the "Buy Now" button. It doesn't list the product name, description or price - just the "Buy Now" in every single column >_<

 

I am now officially at a complete loss as I uploaded the catalog\index.php page straight from the zip folder to the server - without any modifications for other contrib's I have installed and working - and I still get this same error - nothing but Buy Now buttons. When you click on the Buy Now button you get a page that simply says "Product Not Found!" :'(

 

I am under the assumption that this is still something from the index.php page code. Should I be looking at a different page?

 

You can see the error at http://mmherbs.dreamhosters.com The fastest way is to click on "Bulk Herbs / Teas" and you will go straight to the problematic table.

 

If anybody has any ideas on how to fix this I would be most thankful!

 

Tracy

 

PS - Here is the new code on the index.php page in case it helps you to be able to help me ;)

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ 
 adapted for Separate Pricing per Customer 2005/02/06
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce
 Master Products - JOHNSON - 05/07/2003 [email protected]

 Copyright (c) 2003 Suomedia - Dynamic Content Management  

 Released under the GNU General Public License
*/
 require('includes/application_top.php');
 global $customer_group_id;
 if(!isset($customer_group_id)) { $customer_group_id = '0'; }
// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
  $category_depth = 'products'; // display products
} else {
  $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
  $category_parent = tep_db_fetch_array($category_parent_query);
  if ($category_parent['total'] > 0) {
	$category_depth = 'nested'; // navigate through the categories
  } else {
	$category_depth = 'products'; // category has no products, but display the 'no products' message
  }
}
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<?php
 if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
<?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
  $category_links = array_reverse($cPath_array);
  for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
	$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
	$categories = tep_db_fetch_array($categories_query);
	if ($categories['total'] < 1) {
	  // do nothing, go through the loop
	} else {
	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
	  break; // we've found the deepest category the customer is in
	}
  }
} else {
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}

$number_of_categories = tep_db_num_rows($categories_query);

$rows = 0;
while ($categories = tep_db_fetch_array($categories_query)) {
  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '				<td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '			  </tr>' . "\n";
	echo '			  <tr>' . "\n";
  }
}

// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php //include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
					 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
					 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
					 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

asort($define_list);

$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
  if ($value > 0) $column_list[] = $key;
}

// BOF Separate Pricing Per Customer
  if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
  }
  // this will build the table with specials prices for the retail group or update it if needed
  // this function should have been added to includes/functions/database.php
  if ($customer_group_id == '0') {
  tep_db_check_age_specials_retail_table(); 
  }
  $status_product_prices_table = false;
  $status_need_to_get_prices = false;

  // find out if sorting by price has been requested
  if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
$_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
  $status_need_to_get_prices = true;
  }
  }

  if ($status_need_to_get_prices == true && $customer_group_id != '0') { 
  $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
  // the table with product prices for a particular customer group is re-built only a number of times per hour
  // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
  // to trigger the update the next function is called (new function that should have been
  // added to includes/functions/database.php)
  tep_db_check_age_products_group_prices_cg_table($customer_group_id);
  $status_product_prices_table = true;   

  } // end if ($status_need_to_get_prices == true && $customer_group_id != '0')
// EOF Separate Pricing Per Customer

$select_column_list = '';

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
	  $select_column_list .= 'p.products_model, ';
	  break;
	case 'PRODUCT_LIST_NAME':
	  $select_column_list .= 'pd.products_name, ';
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $select_column_list .= 'm.manufacturers_name, ';
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $select_column_list .= 'p.products_quantity, ';
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $select_column_list .= 'p.products_image, ';
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $select_column_list .= 'p.products_weight, ';
	  break;
  }
}

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";		
} else { // either retail or no need to get correct special prices
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";	
} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m  left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;  
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";	
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS . " p" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } // end else { // either retail...
// EOF Separate Pricing per Customer
  }
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
	  break;
	}
  }
} else {
  $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
  $sort_order = substr($HTTP_GET_VARS['sort'], 1);
  $listing_sql .= ' order by ';
  switch ($column_list[$sort_col-1]) {
	case 'PRODUCT_LIST_MODEL':
	  $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_NAME':
	  $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $listing_sql .= "pd.products_name";
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_PRICE':
	  $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
  }
}
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
  } else {
	$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
  }
  $filterlist_query = tep_db_query($filterlist_sql);
  if (tep_db_num_rows($filterlist_query) > 1) {
	echo '			<td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
	if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	  echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
	} else {
	  echo tep_draw_hidden_field('cPath', $cPath);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
	}
	echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
	while ($filterlist = tep_db_fetch_array($filterlist_query)) {
	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
	}
	echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
	echo '</form></td>' . "\n";
  }
}

// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['manufacturers_image'];
} elseif ($current_category_id) {
  $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['categories_image'];
}
?>
		<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
  </tr>
</table></td>
<?php
 } else { // default page
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="main"><?php echo tep_customer_greeting(); ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php //include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>
<?php
//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
	</table></td>
  </tr>
</table></td>
<?php
}
?>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </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'); ?>

~Tracy
 

Link to comment
Share on other sites

I did go back and re-merge the index page (for the umpteenth time now - LOL) and I am getting closer. I do at least get the product table now - but each column contains the "Buy Now" button. It doesn't list the product name, description or price - just the "Buy Now" in every single column >_<

 

I am now officially at a complete loss as I uploaded the catalog\index.php page straight from the zip folder to the server - without any modifications for other contrib's I have installed and working - and I still get this same error - nothing but Buy Now buttons. When you click on the Buy Now button you get a page that simply says "Product Not Found!" :'(

 

I am under the assumption that this is still something from the index.php page code. Should I be looking at a different page?

 

Ah Hah!! I found the culprit in the product_listing.php file :thumbsup: YAY!!

 

So that means both problems above, with the long long code files (sorry guys) are now resolved! :blush:

 

Tracy :D

~Tracy
 

Link to comment
Share on other sites

Ah Hah!! I found the culprit in the product_listing.php file :thumbsup: YAY!!

 

So that means both problems above, with the long long code files (sorry guys) are now resolved! :blush:

 

Tracy :D

 

Good to hear all your problem solved! But just as a note for others who may come across the same errors (unknown table, unknown ... etc. in sql queries), you said your using MySQL version 5. There's a MySQL 5 Compatibility issue as noted in update-20060817.txt included in oscommerce-2.2ms2-060817 update release. So you may want to read that document as it'd help you understand and solve th eproblem.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Good to hear all your problem solved! But just as a note for others who may come across the same errors (unknown table, unknown ... etc. in sql queries), you said your using MySQL version 5. There's a MySQL 5 Compatibility issue as noted in update-20060817.txt included in oscommerce-2.2ms2-060817 update release. So you may want to read that document as it'd help you understand and solve th eproblem.

 

Ken

 

OMG! I hadn't seen that little text file hiding in there before :blush: Well, I haven't experienced any of the issues they have fixes for in regards to the MySQL 5 - but I will be implementing the fixes or knowing my luck, I will get the joys of experiencing them while trying to get the rest of the store working properly with this new contrib, and I'll spend hours trying to figure out why in the world it isn't working - LOL

 

Thanks Ken!!

 

Tracy

~Tracy
 

Link to comment
Share on other sites

If i have an item with no attributes (sizes colors etc:) the item displays correct amount, adds to the cart correctly and i have no problems, however when an item has attributes, it displays whole pricing in the heading, retail pricing in the size drop down and when i add an item to the cart it adds wholesale pricing and retail pricing together !!!

 

resulting in a $50 retail item, and $30 wholesale item (when logged in as wholesale) adding to the cart for $80 ?!?!

The code looks the normal one, but might not be the problem that you set the price of the attribute as the total price instead of the difference it should make on the price (see the osC demo site for a product with attributes).

 

Actually, in the next version of SPPC (which I have been promising for a while now, I know, I know) it will be possible to set customer group prices for the attributes too (and hide them for customers groups too, that part is not completely finished by now, the rest is).

Link to comment
Share on other sites

any comments on what's the most recent, yet stable, complete install? all the way back to v4.1, there's a folder that says "upgrade_from_40_to_version_41" - does this mean i need to install the 4.0 version first and then apply the bug fixes individually?
You can use the latest version. It needs a few bug fixes (some queries are not up to snuff yet with regard to MySQL5, you might find the better ones in the thread :) ). The upgrade folder was for people who had 4.0 already installed.
Link to comment
Share on other sites

when accessing the webpage, it shows an error refered to an undefined function in catalog/includes/classes/shopping_cart.php. The function is serialize().
Huh? serialize is a function in PHP and a search in one of my test osC installations only found that function used in a contribution by Chemo (in connection with category-tree).
Link to comment
Share on other sites

Huh? serialize is a function in PHP and a search in one of my test osC installations only found that function used in a contribution by Chemo (in connection with category-tree).

Well, I only have the Dynamenu contrib which might be similar tot that one. In any case, as i said before, if i comment the lines where that function is, i get another error from the includes/box/shopping_cart.php

Isn't it weird? <_<

Link to comment
Share on other sites

Is it possible to easily modify the SPPC contribution so that my new "wholesale" group only sees products that have wholesale prices.

 

After looking at the Hide Products from SPPC Customers contribution -- I'm thinking that might not be the solution for me. Or is it?

 

Can you help me with this? Or has someone already done this?

 

Thank you so much!

Link to comment
Share on other sites

Modify the catalog\includes\languages\english\login.php file to include the Site Administrator's email address. This email address is used for wholesale account notifications. You can find the appropriate section of that file by doing a search for the keyword root.

 

How do i do above?

thanks

Link to comment
Share on other sites

In any case, as i said before, if i comment the lines where that function is, i get another error from the includes/box/shopping_cart.php
Maybe it is an idea to show those lines with some lines before and after here?
Link to comment
Share on other sites

Is it possible to easily modify the SPPC contribution so that my new "wholesale" group only sees products that have wholesale prices.

 

After looking at the Hide Products from SPPC Customers contribution -- I'm thinking that might not be the solution for me. Or is it?

The Hide Products from customer groups for SPPC does that. If you want to still have it in the catalog but wholesale customers should not be able to buy it, the Hide Price if $0 contribution might be another option for you.
Link to comment
Share on other sites

Modify the catalog\includes\languages\english\login.php file to include the Site Administrator's email address. This email address is used for wholesale account notifications. You can find the appropriate section of that file by doing a search for the keyword root.

 

How do i do above?

Simply change the email address in define('SPPC_TOGGLE_LOGIN_PASSWORD', 'root@localhost'); to what you need it to be.
Link to comment
Share on other sites

The code looks the normal one, but might not be the problem that you set the price of the attribute as the total price instead of the difference it should make on the price (see the osC demo site for a product with attributes).

 

Actually, in the next version of SPPC (which I have been promising for a while now, I know, I know) it will be possible to set customer group prices for the attributes too (and hide them for customers groups too, that part is not completely finished by now, the rest is).

 

 

I was wondering if the code changes for hiding product attributes for customer groups was available. This is an excellent contribution and I have been playing with the code to get the attributes hidden with no success.

 

Richard

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...