Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

T think that is the catalog\featured_products.php. I'm only using the file featured.php in includes/modules.
Two versions, the first one "plain vanilla", the second one with dividing lines and more flexible in the number of rows. The plan was to upload it as a contribution.... but haven't had enough time to check the whole thing thoroughly as I read somewhere that there were known bugs with solutions not put into the more recent featured products files.

<?php
/*
 $Id: featured_products.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $
 adapted for Separate Pricing Pricing Per Customer 2006/02/25

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FEATURED_PRODUCTS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FEATURED_PRODUCTS));
?>
<!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 //-->
<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_products_new.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>
<?php
///// To random featured products
//  list($usec, $sec) = explode(' ', microtime());
//  srand( (float) $sec + ((float) $usec * 100000) );
//  $mtm= rand();
//////  
  $featured_products_array = array();
  // query changed for SPPC: NULL as specials_new_products_price, joining with table specials removed
			$featured_products_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added DESC, pd.products_name";
// to random//  $featured_products_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm)";
  $featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_FEATURED_PRODUCTS);

 if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?> </td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td> <!-- Featured Products Main Page Box -->
	 <table bgcolor="ffffff" border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if ($featured_products_split->number_of_rows > 0) {
$featured_products_query = tep_db_query($featured_products_split->sql_query);
// 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;
 }

 if (($no_of_products = tep_db_num_rows($featured_products_query)) > 0) {
  while ($_featured_products = tep_db_fetch_array($featured_products_query)) {
$featured_products[] = $_featured_products;
$list_of_prdct_ids[] = $_featured_products['products_id'];
} 

  $select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
  if ($no_of_products > 1) {
  for ($n = 1; $n < count($list_of_prdct_ids); $n++) {
  $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' ";   
  }
  }
// get all customers_group_prices for products with the particular customer_group_id
// however not necessary for customer_group_id == 0
if ($customer_group_id != '0') {
 $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."'");
while ($pg_array = tep_db_fetch_array($pg_query)) {
$new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '');
}

  for ($x = 0; $x < $no_of_products; $x++) {
// replace products prices with those from customers_group table
	if(!empty($new_prices)) {
	for ($i = 0; $i < count($new_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
		$featured_products[$x]['products_price'] = $new_prices[$i]['products_price'];
		}
	}
} // end if(!empty($new_prices)
  } // end for ($x = 0; $x < $no_of_products; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials
$specials_query = tep_db_query("select products_id, specials_new_products_price from specials where (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "' ");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price']);
}

// replace products_price with the correct specials_new_products_price
if(!empty($new_s_prices)) {
for ($x = 0; $x < $no_of_products; $x++) { 
	for ($i = 0; $i < count($new_s_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
		$featured_products[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
		}
	   }
   } 
} // // end if(!empty($new_s_prices)

//	while ($featured_products = tep_db_fetch_array($featured_products_query)) {
for ($x = 0; $x < $no_of_products; $x++) {
  if ( !tep_not_null($featured_products[$x]['specials_new_products_price']) ) {
	$products_price = '<s>' . $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($featured_products[$x]['specials_new_products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</span>';
  } else {
	$products_price = $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id']));
  }
?>
	  <tr>
		<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products[$x]['products_image'], $featured_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
		<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '"><b><u>' . $featured_products[$x]['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products[$x]['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products[$x]['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
		<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	  </tr>
	  <tr>
		<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
}
 } else {
?>
	  <tr>
		<td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
 }
?>
	</table>
	</td>
  </tr>
<?php
 if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?></td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table>
   </td>
  </tr>
<?php
 }
?>
</table></td>
<!-- 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'); ?>

The elaborate one:

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 Featured Products V1.5.2
 adapted for Separate Pricing Per Customer v4.1 2006/02/26
 and made flexible for number of columns (default 3), added dividing lines ($color_v and $color_h)
 see line 28 and further to define these variables (set to background color if you don't want them)
 Displays a list of featured products, selected from admin
 For use as an Infobox instead of the "New Products" Infobox  
*/
?>
<!-- featured_products //-->
<?php
if(FEATURED_PRODUCTS_DISPLAY == 'true')
{
 $featured_products_category_id = $new_products_category_id;
 $cat_name_query = tep_db_query("select categories_name from categories_description where categories_id = '" . $featured_products_category_id . "' limit 1");
 $cat_name_fetch = tep_db_fetch_array($cat_name_query);
 $cat_name = $cat_name_fetch['categories_name'];
 $info_box_contents = array();

 $color_h = '#bbc3d3'; // color of horizontal lines
 $color_v = '#bbc3d3'; // color of vertical lines
 $no_of_columns = 3;


 if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {
$info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

 list($usec, $sec) = explode(' ', microtime());
 srand( (float) $sec + ((float) $usec * 100000) );
 $mtm= rand();
// 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;
 }

$featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p  left join " . TABLE_FEATURED . " f using(products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) where p.products_status = '1' and f.status = '1' and pd.language_id = '" . (int)$languages_id . "' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
 } else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_FEATURED . " f using(products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id), " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c  where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' and pd.language_id = '" . (int)$languages_id . "' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
 }

 if (($no_of_featured_prdcts = tep_db_num_rows($featured_products_query)) > 0) {
while ($_featured_products = tep_db_fetch_array($featured_products_query)) {
$featured_products[] = $_featured_products;
$list_of_prdct_ids[] = $_featured_products['products_id'];
} 

$_select_list_of_prdct_ids = implode("','", $list_of_prdct_ids);
$select_list_of_prdct_ids = "'". $_select_list_of_prdct_ids . "'";

// get all customers_group_prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
 if ($customer_group_id != '0') {
 $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."'");
while ($pg_array = tep_db_fetch_array($pg_query)) {
$new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '');
}

  for ($x = 0; $x < $no_of_featured_prdcts; $x++) {
// replace products prices with those from customers_group table
	if(!empty($new_prices)) {
	for ($i = 0; $i < count($new_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
		$featured_products[$x]['products_price'] = $new_prices[$i]['products_price'];
		}
	}
} // end if(!empty($new_prices)
  } // end for ($x = 0; $x < $no_of_featured_prdcts; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials
$specials_query = tep_db_query("select products_id, specials_new_products_price, status as specstat from specials where products_id in (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "' ");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price'], 'specstat' => $specials_array['specstat']);
}

// add correct specials_new_products_price
if(!empty($new_s_prices)) {
for ($x = 0; $x < $no_of_featured_prdcts; $x++) { 
	for ($i = 0; $i < count($new_s_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
		$featured_products[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
		$featured_products[$x]['specstat'] = $new_s_prices[$i]['specstat'];
		}
	   }
   } 
} // // end if(!empty($new_s_prices)

 } // end if ($no_of_featured_prdcts = tep_db_num_rows($featured_products_query)) > 0)


// EOF Separate Pricing Per Customer

 $row = 0;
 $col = 0; 
 $num = 1;
 // we need to know what the last row is, because the td on that row should not have a bottom border
 $last_row = ( $no_of_featured_prdcts % $no_of_columns == 0 ? ($no_of_featured_prdcts / $no_of_columns) -1 :  floor($no_of_featured_prdcts / $no_of_columns ));

// BOF Separate Pricing Per Customer  
//  while ($featured_products = tep_db_fetch_array($featured_products_query)) {
for ($x = 0; $x < $no_of_featured_prdcts; $x++) {
  if ($num == 1) { new contentBoxHeading($info_box_contents); }
// $featured_products[$x]['products_name'] = tep_get_products_name($featured_products[$x]['products_id']);
if($featured_products[$x]['specstat']) {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="' . (floor(100 / $no_of_columns)) . '%" valign="top" style="padding-top: 4px; '. ( $row  < $last_row ? 'border-bottom: 1px solid ' . $color_h . '; ': '') . ( $col < ($no_of_columns - 1) ? 'border-right: 1px solid ' . $color_v . ';"': '"'),
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products[$x]['products_image'], $featured_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . $featured_products[$x]['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . 
									   $currencies->display_price($featured_products[$x]['specials_new_products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</span>');
} else {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="' . (floor(100 / $no_of_columns)) . '%" valign="top" style="padding-top: 4px; '. ( $row  < $last_row ? 'border-bottom: 1px solid ' . $color_h . '; ': '') . ( $col < ($no_of_columns - 1) ? 'border-right: 1px solid ' . $color_v . ';"': '"'),
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products[$x]['products_image'], $featured_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . $featured_products[$x]['products_name'] . '</a><br>' . $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])));
}
// EOF Separate Pricing Per Customer
// if we reached the last of the products, make sure the row of table cells is filled with empty cells if needed
// just adding spaces for text does not produce an empty cell: use a ? instead
if ($num == $no_of_featured_prdcts ) {
  for ($i = $col + 1; $i < $no_of_columns; $i++) {
  $info_box_contents[$row][$i] = array('align' => 'center', 'params' => 'class="smallText" width="' . (floor(100 / $no_of_columns)) . '%" valign="top" style="padding-top: 4px; '. ( $row  < $last_row ? 'border-bottom: 1px solid ' . $color_h . '; ': '') . ( $i < ($no_of_columns - 1) ? 'border-right: 1px solid ' . $color_v . ';"': '"'),
'text' => '?');
  }
} // end if ($num == $no_of_featured_prdcts )

$col ++;
$num++;
if ($col > ($no_of_columns -1)) {
  $col = 0;
  $row ++;
}
 } // end for ($x=0; $x < $no_of_featured_prdcts; $x++)
 if($num > 1) {

  new contentBox($info_box_contents);
 }
} else // If it's disabled, then include the original New Products box
{
  include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
}
?>
<!-- featured_products_eof //-->

Share this post


Link to post
Share on other sites

i have install SPPC and it is working great! ... question...

 

on the account creation page there are two new fields in the "Company Details" section:

 

Company Name:

Company's tax id number:

 

when a customer fills out this information... i get an email saying that a customer has just created an account and entered a Company Name... this shows me that this person wants to have "wholesale privileges"

 

i want to make that email include the tax number as well... how would i do this??

 

ALSO

 

is there some "template code" i could go by to add my own fields to the create_account.php page ???

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

Share this post


Link to post
Share on other sites
I must add that we have regular jobs and do understand deadlines. I would suggest that if anyone ever needs fast, immediate support that they hire someone. This is OS which means there isn't a standard tech support offered.

 

Yes I understand that, I just wrote that I would appreciate fast support. I didnt require it.

 

Anyway, I'm not sure where to look for programmers with experience of osCommerce and its contributions.

Share this post


Link to post
Share on other sites
I'm only using the file featured.php in includes/modules.
I was in a bit of a hurry therefore I overlooked an even slightly more elaborate version of the modules/featured.php. In this version you can also change the style of the lines (dotted, solid, etc.).

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 Featured Products V1.5.2
 adapted for Separate Pricing Per Customer v4.1 2006/02/26
 and made flexible for number of columns (default 3), added dividing lines ($color_v and $color_h)
 see line 28 and further to define these variables (set to background color if you don't want them)
 Displays a list of featured products, selected from admin
 For use as an Infobox instead of the "New Products" Infobox  
*/
?>
<!-- featured_products //-->
<?php
if(FEATURED_PRODUCTS_DISPLAY == 'true')
{
 $featured_products_category_id = $new_products_category_id;
 $cat_name_query = tep_db_query("select categories_name from categories_description where categories_id = '" . $featured_products_category_id . "' limit 1");
 $cat_name_fetch = tep_db_fetch_array($cat_name_query);
 $cat_name = $cat_name_fetch['categories_name'];
 $info_box_contents = array();

 $color_h = '#bbc3d3'; // color of horizontal lines
 $color_v = '#bbc3d3'; // color of vertical lines
 $border_style_h = "solid"; // style of horizontal lines: solid, dashed, dotted
 $border_style_v = "solid"; // style of vertical lines
 $no_of_columns = 3;

// 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;
 }
// EOF Separate Pricing Per Customer

 if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {
$info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

 list($usec, $sec) = explode(' ', microtime());
 srand( (float) $sec + ((float) $usec * 100000) );
 $mtm= rand();

$featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p  left join " . TABLE_FEATURED . " f using(products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) where p.products_status = '1' and f.status = '1' and pd.language_id = '" . (int)$languages_id . "' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
 } else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, NULL as specstat, NULL as specials_new_products_price, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_FEATURED . " f using(products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id), " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c  where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' and pd.language_id = '" . (int)$languages_id . "' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
 }

 if (($no_of_featured_prdcts = tep_db_num_rows($featured_products_query)) > 0) {
while ($_featured_products = tep_db_fetch_array($featured_products_query)) {
$featured_products[] = $_featured_products;
$list_of_prdct_ids[] = $_featured_products['products_id'];
} 

$_select_list_of_prdct_ids = implode("','", $list_of_prdct_ids);
$select_list_of_prdct_ids = "'". $_select_list_of_prdct_ids . "'";

// get all customers_group_prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
 if ($customer_group_id != '0') {
 $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."'");
while ($pg_array = tep_db_fetch_array($pg_query)) {
$new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '');
}

  for ($x = 0; $x < $no_of_featured_prdcts; $x++) {
// replace products prices with those from customers_group table
	if(!empty($new_prices)) {
	for ($i = 0; $i < count($new_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
		$featured_products[$x]['products_price'] = $new_prices[$i]['products_price'];
		}
	}
} // end if(!empty($new_prices)
  } // end for ($x = 0; $x < $no_of_featured_prdcts; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials
$specials_query = tep_db_query("select products_id, specials_new_products_price, status as specstat from specials where products_id in (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "' ");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price'], 'specstat' => $specials_array['specstat']);
}

// add correct specials_new_products_price
if(!empty($new_s_prices)) {
for ($x = 0; $x < $no_of_featured_prdcts; $x++) { 
	for ($i = 0; $i < count($new_s_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
		$featured_products[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
		$featured_products[$x]['specstat'] = $new_s_prices[$i]['specstat'];
		}
	   }
   } 
} // // end if(!empty($new_s_prices)
 } // end if ($no_of_featured_prdcts = tep_db_num_rows($featured_products_query)) > 0)


// EOF Separate Pricing Per Customer

 $row = 0;
 $col = 0; 
 $num = 1;
 // we need to know what the last row is, because the td on that row should not have a bottom border
 $last_row = ( $no_of_featured_prdcts % $no_of_columns == 0 ? ($no_of_featured_prdcts / $no_of_columns) -1 :  floor($no_of_featured_prdcts / $no_of_columns ));

// BOF Separate Pricing Per Customer  
//  while ($featured_products = tep_db_fetch_array($featured_products_query)) {
for ($x = 0; $x < $no_of_featured_prdcts; $x++) {
  if ($num == 1) { new contentBoxHeading($info_box_contents); }
// $featured_products[$x]['products_name'] = tep_get_products_name($featured_products[$x]['products_id']);
if($featured_products[$x]['specstat']) {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="' . (floor(100 / $no_of_columns)) . '%" valign="top" style="padding-top: 4px; '. ( $row  < $last_row ? 'border-bottom: 1px ' . $border_style_h . ' ' . $color_h . '; ': '') . ( $col < ($no_of_columns - 1) ? 'border-right: 1px ' . $border_style_v . '  ' . $color_v . ';"': '"'),
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products[$x]['products_image'], $featured_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . $featured_products[$x]['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . 
									   $currencies->display_price($featured_products[$x]['specials_new_products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</span>');
} else {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="' . (floor(100 / $no_of_columns)) . '%" valign="top" style="padding-top: 4px; '. ( $row  < $last_row ? 'border-bottom: 1px ' . $border_style_h . ' ' . $color_h . '; ': '') . ( $col < ($no_of_columns - 1) ? 'border-right: 1px ' . $border_style_v . '  ' . $color_v . ';"': '"'),
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products[$x]['products_image'], $featured_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products[$x]['products_id']) . '">' . $featured_products[$x]['products_name'] . '</a><br>' . $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])));
}
// EOF Separate Pricing Per Customer
// if we reached the last of the products, make sure the row of table cells is filled with empty cells if needed
// just adding spaces for text does not produce an empty cell: use a ? instead
if ($num == $no_of_featured_prdcts ) {
  for ($i = $col + 1; $i < $no_of_columns; $i++) {
  $info_box_contents[$row][$i] = array('align' => 'center', 'params' => 'class="smallText" width="' . (floor(100 / $no_of_columns)) . '%" valign="top" style="padding-top: 4px; '. ( $row  < $last_row ? 'border-bottom: 1px ' . $border_style_h . ' ' . $color_h . '; ': '') . ( $i < ($no_of_columns - 1) ? 'border-right: 1px ' . $border_style_v . ' ' . $color_v . ';"': '"'),
'text' => '?');
  }
} // end if ($num == $no_of_featured_prdcts )

$col ++;
$num++;
if ($col > ($no_of_columns -1)) {
  $col = 0;
  $row ++;
}
 } // end for ($x=0; $x < $no_of_featured_prdcts; $x++)
 if($num > 1) {

  new contentBox($info_box_contents);
 }
} else // If it's disabled, then include the original New Products box
{
  include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
}
?>
<!-- featured_products_eof //-->

Share this post


Link to post
Share on other sites

Andrew,

when a customer fills out this information... i get an email saying that a customer has just created an account and entered a Company Name... this shows me that this person wants to have "wholesale privileges"

 

i want to make that email include the tax number as well... how would i do this??

Adding $company_tax_id somewhere in the email message that is sent. Check the code that starts around line 270 in create_account.php:

	  if ( ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) ) { 
  $alert_email_text = "Please note that " . $firstname . " " . $lastname . " of the company: " . $company . " has created an account.";
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Company account created', $alert_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }
// EOF Separate Pricing Per Customer: alert shop owner of account created by a company

 

is there some "template code" i could go by to add my own fields to the create_account.php page ???
I'm not aware of any contribution that does this, but I never looked for it either. Check the contribution section I would say.

Share this post


Link to post
Share on other sites

OK thx another question then...

 

when i am viewing orders from various customers, how can i make the order show whether the customer is retail or wholesale?

 

i can tell easily enough which CUSTOMERS are retail or wholesale but i would like the order to say so also as i am not the one processing the order...

 

can i make "retail" or "wholesale" appear beside each model number in the order???


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

-David Gilmour

Share this post


Link to post
Share on other sites

Hello,

Thanks for the contribution, it works great, but i have a problem.

I have a modified specials box and i have no idea how to integrate your contribution...

This is the code:

<?php
/*
 $Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<?php
$count = "1";
 $specials_query_raw = "select p.products_id, pd.products_description, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC";
 $specials_split = new splitPageResults($specials_query_raw, 4);

$specials_query = tep_db_query($specials_split->sql_query);
while ($specials = tep_db_fetch_array($specials_query)) {
  $row++;
	if ($count =="1" || $count =="3") {
		echo "<tr><td width=\"8\"><img src=\"images/design/2.jpg\"></td>";
	}
  echo '<td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '"><b>' . $specials['products_name'] . '</b><br><img src="images/' . $specials['products_image'] . '" border="0" width="125"><br></a><span class="cut">' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><span class="red">' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><br><a href="index.php?action=buy_now&products_id=' . $specials['products_id'] . '"><img src="images/design/buy-it.jpg" width="78" height="20" border="0"></a><a href="product_info.php?products_id=' . $specials['products_id'] . '"><img src="images/design/info.jpg" width="88" height="19" border="0"></a></td><td width=\"8\"><img src="images/design/2.jpg"></td>' . "\n";

	if ($count =="2" || $count =="4") {
		echo "</tr><tr><td colspan=5 align=center><img src=\"images/design/1.jpg\"><img src=\"images/design/1.jpg\"></td></tr>";
	}
	$count ++;
	if ($count=="5") {
		$count = "1";
	}
}
?>

Can somebody help me to integrate Seprate Prices?

 

Thank you!

Share this post


Link to post
Share on other sites

i am running SPPC and have 2 category's; wholesale & retail

 

is there a way i can have customers who enter a tax ID and a Company name AUTOMATICALLY added to my wholesale SPPC category???

 

but they should ONLY be added to the SPPC wholesale category if they enter Tax ID AND a Company Name...

 

everyone else should get added to the SPPC retail category by default


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

-David Gilmour

Share this post


Link to post
Share on other sites
when i am viewing orders from various customers, how can i make the order show whether the customer is retail or wholesale?

 

i can tell easily enough which CUSTOMERS are retail or wholesale but i would like the order to say so also as i am not the one processing the order...

 

can i make "retail" or "wholesale" appear beside each model number in the order???

Next to each model number seems a bit strange to me, but you can adapt the code to add it to where you want. First I added the customer_group_name to the class order (admin/includes/order.php, starts around line 27):

	function query($order_id) {
  // BOF add SPPC customers_group_name to the info
  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'");
  // EOF add SPPC customer_group_name to the info
  $order = tep_db_fetch_array($order_query);

  $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  while ($totals = tep_db_fetch_array($totals_query)) {
	$this->totals[] = array('title' => $totals['title'],
							'text' => $totals['text']);
  }

  $this->info = array('currency' => $order['currency'],
					  'currency_value' => $order['currency_value'],
					  'payment_method' => $order['payment_method'],
					  'cc_type' => $order['cc_type'],
					  'cc_owner' => $order['cc_owner'],
					  'cc_number' => $order['cc_number'],
					  'cc_expires' => $order['cc_expires'],
					  'date_purchased' => $order['date_purchased'],
					  'orders_status' => $order['orders_status'],
					  'last_modified' => $order['last_modified']);

  $this->customer = array('name' => $order['customers_name'],
						  'company' => $order['customers_company'],
						  'street_address' => $order['customers_street_address'],
						  'suburb' => $order['customers_suburb'],
						  'city' => $order['customers_city'],
						  'postcode' => $order['customers_postcode'],
						  'state' => $order['customers_state'],
						  'country' => $order['customers_country'],
						  'format_id' => $order['customers_address_format_id'],
			  // BOF SPPC
			  'customers_group_name' => $order['customers_group_name'],
			  // EOF SPPC
						  'telephone' => $order['customers_telephone'],
						  'email_address' => $order['customers_email_address']);

If you want the customer group name to appear below the customers email address add this (code for email address shown too, starts around line 150):

			  <tr>
			<td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
			<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
		  </tr>
	  <!-- // BOF Separate Pricing Per Customer -->
		  <tr>
			<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>
			<td class="main"><?php echo $order->customer['customers_group_name']; ?></td>
		  </tr>
	 <!-- // EOF Separate Pricing Per Customer -->

Share this post


Link to post
Share on other sites
I was in a bit of a hurry therefore I overlooked an even slightly more elaborate version of the modules/featured.php. In this version you can also change the style of the lines (dotted, solid, etc.).

 

 

Thanks Jan! Seems to work!

Share this post


Link to post
Share on other sites
Next to each model number seems a bit strange to me, but you can adapt the code to add it to where you want. First I added the customer_group_name to the class order (admin/includes/order.php, starts around line 27):

 

did you mean admin/includes/classes/order.php ????


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

-David Gilmour

Share this post


Link to post
Share on other sites
did you mean admin/includes/classes/order.php ????

 

Yes. I think that is what Jan meant to say... I was able to follow those instructions (using admin/includes/classes/order.php) and it worked.

Share this post


Link to post
Share on other sites

If you want the customer group name to appear below the customers email address add this (code for email address shown too, starts around line 150):

<tr>
<td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
</tr>
<!-- // BOF Separate Pricing Per Customer -->
<tr>
<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>
<td class="main"><?php echo $order->customer['customers_group_name']; ?></td>
</tr>
<!-- // EOF Separate Pricing Per Customer -->

 

and what file does this code go into??? it didn't seem to fit in admin/includes/classes/order.php ....???


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

-David Gilmour

Share this post


Link to post
Share on other sites

also...

 

how do add extra fields for customers on the account creation page?

 

i want to additional fields for the business to complete... i also want it set up so that i ONLY get the business notification if ALL fields are completed...

 

the help in this topic so far has been exceptional btw ;)

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

Share this post


Link to post
Share on other sites
and what file does this code go into??? it didn't seem to fit in admin/includes/classes/order.php ....???

 

This would go in /admin/orders.php

Share this post


Link to post
Share on other sites
I have a modified specials box and i have no idea how to integrate your contribution...
To change it for SPPC I'm almost 100% sure you only have to add the customers_group_id to the query (and making sure it is available for the code):

<?php
/*
$Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<?php
 // BOF Separate Price per Customer
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }
  // EOF Separate Price per Customer

$count = "1";
$specials_query_raw = "select p.products_id, pd.products_description, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and customers_group_id = '" .$customer_group_id. "' order by s.specials_date_added DESC";
$specials_split = new splitPageResults($specials_query_raw, 4);

$specials_query = tep_db_query($specials_split->sql_query);
while ($specials = tep_db_fetch_array($specials_query)) {
$row++;
if ($count =="1" || $count =="3") {
echo "<tr><td width=\"8\"><img src=\"images/design/2.jpg\"></td>";
}
echo '<td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '"><b>' . $specials['products_name'] . '</b><br><img src="images/' . $specials['products_image'] . '" border="0" width="125"><br></a><span class="cut">' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><span class="red">' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><br><a href="index.php?action=buy_now&products_id=' . $specials['products_id'] . '"><img src="images/design/buy-it.jpg" width="78" height="20" border="0"></a><a href="product_info.php?products_id=' . $specials['products_id'] . '"><img src="images/design/info.jpg" width="88" height="19" border="0"></a></td><td width=\"8\"><img src="images/design/2.jpg"></td>' . "\n";

if ($count =="2" || $count =="4") {
echo "</tr><tr><td colspan=5 align=center><img src=\"images/design/1.jpg\"><img src=\"images/design/1.jpg\"></td></tr>";
}
$count ++;
if ($count=="5") {
$count = "1";
}
}
?>

Share this post


Link to post
Share on other sites
how do add extra fields for customers on the account creation page?
Have you tried Customers extra fields?
i also want it set up so that i ONLY get the business notification if ALL fields are completed...
Look at the code for sending the email that looks for the fields (just above <!doctype html public.... ) and add your own field(s):

	  if ( ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) && tep_not_null($your_own_field) ) { 
  $alert_email_text = "Please note that " . $firstname . " " . $lastname . " of the company: " . $company . " has created an account.";

Obviously this only looks if anything has been added, not if it is valid input for the field (if you enter a "1" in the field for tax number it will be valid in this context, not in the sense of being a valid tax id number, but that is not something SPPC can check for out of the box).

Share this post


Link to post
Share on other sites
To change it for SPPC I'm almost 100% sure you only have to add the customers_group_id to the query (and making sure it is available for the code):

...

That works :)

 

Thank You JanZ, i thought nobody will help me.

 

Thanks a lot!

Share this post


Link to post
Share on other sites

i have a suggestion... what if the next version will come with a modified admin/specials.php?

something like ... for each group a price box. will be easier for those with many specials per group, for the same products

 

thanks

Share this post


Link to post
Share on other sites
i have a suggestion... what if the next version will come with a modified admin/specials.php?

something like ... for each group a price box. will be easier for those with many specials per group, for the same products

It is not the most ideal user interface if you always have a lot of specials, but it was one of the parts of SPPC that wasn't working well to start with. So when we managed to make it work as it should the attention went to other parts...

 

Have you considered Admin Specials by Categories for SPPC (an adaptation of Carine Bruyndoncx's contribution). From what I remember you can also do several products in a category/per group on one page so you could save yourself some time there.

Share this post


Link to post
Share on other sites
This would go in /admin/orders.php

ok i got it working thanx

 

one more question about it...

 

can i change this

 

TABLE_HEADING_CUSTOMERS_GROUPS : Retail

 

to say Customer type: Retail

 

without changing the SQL TABLE name or whatever...?

 

thanx again guys


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

-David Gilmour

Share this post


Link to post
Share on other sites
ok i got it working thanx

 

one more question about it...

 

can i change this

 

TABLE_HEADING_CUSTOMERS_GROUPS : Retail

 

to say Customer type: Retail

 

without changing the SQL TABLE name or whatever...?

 

thanx again guys

 

Herot,

 

Yes. You can do that... Go into /admin/orders.php and make this change:

 

Find the code that JAN created to echo the customer group on the order page...

 

<tr>
<td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
</tr>
<!-- // BOF Separate Pricing Per Customer -->
<tr>
<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>
<td class="main"><?php echo $order->customer['customers_group_name']; ?></td>
</tr>
<!-- // EOF Separate Pricing Per Customer -->

 

Within that code look for this line:

 

<td class="main"><b><?php echo TABLE_HEADING_CUSTOMERS_GROUPS .":"; ?></b></td>

 

CHANGE that line to this:

 

<td class="main"><b>Customer Type:</b></td>

 

That should do the trick....

 

Good Luck

 

Nate

Share this post


Link to post
Share on other sites
CHANGE that line to this:

 

CODE

<td class="main"><b>Customer Type:</b></td>

 

 

That should do the trick....

 

Good Luck

 

Nate

works good man thx B)


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

-David Gilmour

Share this post


Link to post
Share on other sites

Hello,

 

Does anyone know why all the clients assigned to different groups still only get the retail prices instead of the prices assigned to their group?

I have checked the databases to see if the new prices were added correctly to the database tables and all seemed OK.

Does anyone know where I should looking for the problem?

 

Thank you very much

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×