Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Is anyone using Unsold Carts MOD??

http://www.oscommerce.com/community/contri...ch,Unsold+Carts

 

The report is fabulous but it shows only the retail price and is confusing the merchant. has anyone tackled making this work with SPPC??

 

 

 

I wouldn't recommend this in the least. People could spam your accounts, they could use stolen CC numbers, and you could lose inventory without getting paid with no recouse against these people especially since there would be little way to track it down.

 

Just my opinion

 

 

OK thats what I thought and will explain this to the merchant.. thanks for the input

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

Oh I just wanted the price to show correctly as to which group they are registered with.. you can not convert the order to complete, only contact the shopper and ask them to ccomplete the order or why they didn't.. or delete the holdings of the cart. I haven't the first clue as to how to tackle this.. I am thinking if the merchant can take a quick peek down and see an unsold cart that is obviously at the wrong pricing (retail vs professional in my case) then they can switch the customer in the admin and contact the customer. here is the code that creates the report:

 

stats_unsold_carts.php

<?php
/*
$Id$

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License

Modified by JM Ivler
Oct 8th, 2003

Modifed by Aalst (stats_unsold_carts.php,v 1.4)
[email protected]
Nov 7th 2003

Modifed by Aalst (stats_unsold_carts.php,v 1.4.1)
[email protected]
Nov 9th 2003

Modifed by Aalst (stats_unsold_carts.php,v 1.4.2)
[email protected]
Nov 10th 2003

Modifed by Aalst (stats_unsold_carts.php,v 1.6)
[email protected]
Nov 12th 2003

Modifed by Aalst (stats_unsold_carts.php,v 1.7)
[email protected]
Nov 13th 2003

Modified by Raimund Berg (stats_unsold_carts.php, v1.8)
[email protected]
Original Idea: Roman Gruhn
Mar 30th, 2004

Modified by Mike McCune (stats_unsold_carts.php, v2.1)
[email protected]
May 30, 2005
*/

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

$tdate = $_POST['tdate'];
if ($_POST['tdate'] == '') $tdate = $_GET['tdate'];
if ($_GET['tdate'] == '') $tdate = '30';

// Delete Entry Begin : Roman Gruhn
if ($HTTP_GET_VARS['action']=='delete') { 
  $reset_query_raw = "delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id=$HTTP_GET_VARS[customer_id]"; 
  tep_db_query($reset_query_raw); 
  $reset_query_raw2 = "delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id=$HTTP_GET_VARS[customer_id]"; 
  tep_db_query($reset_query_raw2); 
  tep_redirect(tep_href_link(FILENAME_STATS_UNSOLD_CARTS, 'delete=1&customer_id='. $HTTP_GET_VARS['customer_id'] . '&tdate=' . $tdate)); 
} 
if ($HTTP_GET_VARS['delete']) { 
  $messageStack->add(MESSAGE_STACK_CUSTOMER_ID . $HTTP_GET_VARS['customer_id'] . MESSAGE_STACK_DELETE_SUCCESS, 'success'); 
} 
// Delete Entry End
?>
<!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>
 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->

<?
function seadate($day)  {
 $rawtime = strtotime("-".$day." days");
 $ndate = date("Ymd", $rawtime);
 return $ndate;
}

function cart_date_short($raw_date) {
 if ( ($raw_date == '00000000') || ($raw_date == '') ) return false;

 $year = substr($raw_date, 0, 4);
 $month = (int)substr($raw_date, 4, 2);
 $day = (int)substr($raw_date, 6, 2);

 if (@date('Y', mktime(0, 0, 0, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime(0, 0, 0, $month, $day, $year));
 } else {
return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime(0, 0, 0, $month, $day, 2037)));
 }
}
?>

<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top">
  <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- 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="2">
  <tr>
	<td align="left" colspan="2">
	<!-- REPORT TABLE BEGIN //-->
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
		  <td class="pageHeading" align="left"  colspan="2"><?php echo HEADING_TITLE; ?></td>
		  <td class="pageHeading" align="right"  colspan="4">
			<form method=post action=<?php echo $PHP_SELF;?> >
			  <table align="right" width="100%">
				<tr class="dataTableContent" align="right">
				  <td><?php echo DAYS_FIELD_PREFIX; ?><input type=text size=4 width=4 value=<?php echo $tdate; ?> name=tdate><?php echo DAYS_FIELD_POSTFIX; ?><input type=submit value="<?php echo DAYS_FIELD_BUTTON; ?>"></td>
				</tr>
			  </table>
			</form>
		  </td>
		</tr>
		<tr class="dataTableHeadingRow">
		  <td class="dataTableHeadingContent" align="left" colspan="1" width="15%"><?php echo TABLE_HEADING_DATE; ?></td>
		  <td class="dataTableHeadingContent" align="left" colspan="1" width="35%"><?php echo TABLE_HEADING_CUSTOMER; ?></td>
		  <td class="dataTableHeadingContent" align="left" colspan="1" width="35%"><?php echo TABLE_HEADING_EMAIL; ?></td>
		  <td class="dataTableHeadingContent" align="left" colspan="3" width="15%"><?php echo TABLE_HEADING_PHONE; ?></td>
		</tr>
		<tr class="dataTableHeadingRow">
		  <td class="dataTableHeadingContent" align="left"   colspan="1" width="20%"><?php echo TABLE_HEADING_MODEL; ?></td>
		  <td class="dataTableHeadingContent" align="left"   colspan="2" width="40%"><?php echo TABLE_HEADING_DESCRIPTION; ?></td>
		  <td class="dataTableHeadingContent" align="center" colspan="1" width="10%"><?php echo TABLE_HEADING_QUANTY; ?></td>
		  <td class="dataTableHeadingContent" align="right"  colspan="1" width="15%"><?php echo TABLE_HEADING_PRICE; ?></td>
		  <td class="dataTableHeadingContent" align="right"  colspan="1" width="15%"><?php echo TABLE_HEADING_TOTAL; ?></td>
		</tr>

<?php
 $ndate = seadate($tdate);
 $query1 = tep_db_query("select cb.customers_id cid,
							 cb.products_id pid,
							 cb.customers_basket_quantity qty,
							 cb.customers_basket_date_added bdate,
							 cus.customers_firstname fname,
							 cus.customers_lastname lname,
							 cus.customers_telephone phone,
							 cus.customers_email_address email
					  from   " . TABLE_CUSTOMERS_BASKET . " cb,
							 " . TABLE_CUSTOMERS . " cus
					  where  cb.customers_basket_date_added >= '" . $ndate . "' and
							 cb.customers_id = cus.customers_id order by cb.customers_basket_date_added desc,
							 cb.customers_id ");
 $results = 0;
 $curcus = "";
 $tprice = 0;
 $totalAll = 0;
 $knt = mysql_num_rows($query1);
 $first_line = true;
 for ($i = 0; $i <= $knt; $i++) {
$inrec = tep_db_fetch_array($query1);

if ($curcus != $inrec['cid']) {
  // output line
  $totalAll += $tprice;
  $tcart_formated = $currencies->format($tprice);
  $cline .= "
		<tr>
		  <td class='dataTableContent' align='right' colspan='6'><b>" . TABLE_CART_TOTAL . "</b>" . $tcart_formated . "</td>
		</tr>
		<tr>
		  <!-- Delete Button : Roman Gruhn //-->
		  <td colspan='6' align='right'><a href=" . tep_href_link(FILENAME_STATS_UNSOLD_CARTS,"action=delete&customer_id=$curcus&tdate=$tdate") . ">" . tep_image_button('button_reset.gif', IMAGE_RESET) . "</a></td>
		</tr>";

  if ($curcus != "") echo $cline;

  // set new cline and curcus
  $curcus = $inrec['cid'];
  $tprice = 0;

  if ($first_line == false) { 
	$cline = "
		<tr>
		  <td colspan=6><br></td>
		</tr>";
  } else {
	$cline = "";
	$first_line = false;
  }
  $cline .= "
		<tr>
		  <td class='dataTableContent' align='left' width='15%'> " . cart_date_short($inrec['bdate']) . "</td>
		  <td class='dataTableContent' align='left' width='35%'><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $inrec['fname'] . " " . $inrec['lname'] . "</a></td>
		  <td class='dataTableContent' align='left' width='35%'><a href='" . tep_href_link('mail.php', 'selected_box=tools&customer=' . $inrec['email']) . "'>" . $inrec['email'] . "</a></td>
		  <td class='dataTableContent' align='left' colspan='3' width='15%'>" . $inrec['phone'] . "</td>
		</tr>";
}

// empty the shopping cart
$query2 = tep_db_query("select  p.products_price price,
								p.products_model model,
								pd.products_name name
						from	" . TABLE_PRODUCTS . " p,
								" . TABLE_PRODUCTS_DESCRIPTION . " pd,
								" . TABLE_LANGUAGES . " l
						where   p.products_id = '" . $inrec['pid'] . "' and
								pd.products_id = p.products_id and
								l.languages_id = pd.language_id");

$inrec2 = tep_db_fetch_array($query2);
$tprice = $tprice + ($inrec['qty'] * $inrec2['price']);

if ($inrec['qty'] != 0) {
  $pprice_formated  = $currencies->format($inrec2['price']);
  $tpprice_formated = $currencies->format(($inrec['qty'] * $inrec2['price']));
  $cline .= "
		<tr class='dataTableRow'>
		  <td class='dataTableContent' align='left'   width='20%'>" . $inrec2['model'] . "</td>
		  <td class='dataTableContent' align='left'   colspan='2' width='40%'><a href='" . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $inrec['pid'] . '&origin=' . FILENAME_STATS_UNSOLD_CARTS . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . "'>" . $inrec2['name'] . "</a></td>
		  <td class='dataTableContent' align='center' width='10%'>" . $inrec['qty'] . "</td>
		  <td class='dataTableContent' align='right'  width='15%'>" . $pprice_formated . "</td>
		  <td class='dataTableContent' align='right'  width='15%'>" . $tpprice_formated . "</td>
		</tr>";
}
 }
 $totalAll_formated = $currencies->format($totalAll);

 $cline .= "
		<tr>
		  <td class='dataTableContent' align='right' colspan='6'><b>" . TABLE_GRAND_TOTAL . "</b>" . $totalAll_formated . "</td>
		</tr>";

 echo $cline;
?>
	</tr>	
	  </table>
	<!-- REPORT TABLE END //-->
	</td>
  </tr>
</table>
 </td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->

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

</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by wkdwich

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

I've got another issue here.. added in Country-State Selector which does a fine job.. there are some changes to the admin that effect the SPPC lines and I need some assistance

 

http://www.oscommerce.com/community/contri...h,country-state

 

In admin/customers.php they request these changes:

 

catalog/admin/customers.php

After line 15:

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');add:

// +Country-State Selector
$refresh = (isset($HTTP_POST_VARS['refresh']) ? $HTTP_POST_VARS['refresh'] : 'false');
// -Country-State Selector

Line 43:
Replace:

	if (isset($HTTP_POST_VARS['entry_zone_id'])) $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['entry_zone_id']);

with:

	// +Country-State Selector
	if (isset($HTTP_POST_VARS['entry_zone_id'])) {
	   $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['entry_zone_id']);
	} else {
	   $entry_zone_id = 0;
	}
	if ($refresh != 'true') {
	// -Country-State Selector

Line 110: 
Delete the following code:

	if (ACCOUNT_STATE == 'true') {
	  if ($entry_country_error == true) {
		$entry_state_error = true;
	  } else {
		$zone_id = 0;
		$entry_state_error = false;
		$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "'");
		$check_value = tep_db_fetch_array($check_query);
		$entry_state_has_zones = ($check_value['total'] > 0);
		if ($entry_state_has_zones == true) {
		  $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "' and zone_name = '" . tep_db_input($entry_state) . "'");
		  if (tep_db_num_rows($zone_query) == 1) {
			$zone_values = tep_db_fetch_array($zone_query);
			$entry_zone_id = $zone_values['zone_id'];
		  } else {
			$error = true;
			$entry_state_error = true;
		  }
		} else {
		  if ($entry_state == false) {
			$error = true;
			$entry_state_error = true;
		  }
		}
	 }
  }

Line 152:
Replace:

  if ($error == false) {
with:

// +Country-State Selector	  
  }  // End if (!$refresh)	
  if (($error == false) && ($refresh != 'true')) {
// -Country-State Selector


Line 196:

Replace:

	  $processed = true;

with:

	  $processed = true;
	  // +Country-State Selector
	  } else if ($refresh == 'true') {
		$cInfo = new objectInfo($HTTP_POST_VARS);
	  }
	  // -Country-State Selector

Line 238:

Replace:

 if ($action == 'edit' || $action == 'update') {

with:

 // +Country-State Selector
 if ($refresh == 'true') {
$entry_state = '';
$cInfo->entry_state = '';
 }
 // -Country-State Selector
 if ($action == 'edit' || $action == 'update') {


Line 333:
Replace:

//--></script>
with:

function refresh_form(form_name) {
  form_name.refresh.value = 'true';
  form_name.submit();
  return true;
  }
//--></script>

Line 369:
Replace:

  <tr><?php echo tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('action')) . 'action=update', 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id); ?>

with:

  <tr><?php echo tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('action')) . 'action=update', 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id); ?>
	 <?php
	 // +Country-State Selector
	 echo tep_draw_hidden_field('refresh','false'); 
	 // -Country-State Selector
	 ?>

Line 581:
Replace:

$entry_state = tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state);
if ($error == true) {
  if ($entry_state_error == true) {
	if ($entry_state_has_zones == true) {
	  $zones_array = array();
	  $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($cInfo->entry_country_id) . "' order by zone_name");
	  while ($zones_values = tep_db_fetch_array($zones_query)) {
		$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
	  }
	  echo tep_draw_pull_down_menu('entry_state', $zones_array) . ' ' . ENTRY_STATE_ERROR;
	} else {
	  echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . ENTRY_STATE_ERROR;
	}
  } else {
	echo $entry_state . tep_draw_hidden_field('entry_zone_id') . tep_draw_hidden_field('entry_state');
  }
} else {
  echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));
}

with:

 // +Country-State Selector
 $entry_state = tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state);
 $zones_array = array();
 $zones_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$cInfo->entry_country_id . "' order by zone_name");
 while ($zones_values = tep_db_fetch_array($zones_query)) {
	$zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);
 }
   if (count($zones_array) > 0) {
	 echo tep_draw_pull_down_menu('entry_zone_id', $zones_array, $cInfo->entry_zone_id);
	 echo tep_draw_hidden_field('entry_state', '');
  } else {
	 echo tep_draw_input_field('entry_state', $entry_state);
  }
  // -Country-State Selector

Line 610:
Replace:

 if ($error == true) {
if ($entry_country_error == true) {
  echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR;
} else {
  echo tep_get_country_name($cInfo->entry_country_id) . tep_draw_hidden_field('entry_country_id');
}
 } else {
echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id);
 }

with:

// +Country-State Selector
echo css_get_country_list('entry_country_id',  $cInfo->entry_country_id,'onChange="return refresh_form(customers);"');
// -Country-State Selector

 

 

Line 15 edit looks like no problems

Line 43 edit looks like no problems

Line 110 edit looks like no problems

Line 152 edit looks like no problems

Line 196 edit looks like no problems

Line 333 edit looks like no problems

Line 369 edit looks like no problems ???

Line 581 edit looks like no problems

Line 610 edit definate is a problem

 

 

so if I make some of the changes requested it is going to screw up my SPPC.. can I get some help please?? It works great in the customer side..

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

PLEASE HELP ME!!

I installed the package according to the instructions but now my front page says this:

1054 - Unknown column 'customers_group_id' in 'where clause'

 

select specials_new_products_price from specials where products_id = '1405' and status and customers_group_id = '0'

 

[TEP STOP]

 

And when I go to my customers via Admin it show this:

1146 - Table 'paperc_paperc_newoscomm.customers_groups' doesn't exist

 

select count(*) as total from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join customers_groups cg on c.customers_group_id = cg.customers_group_id

 

[TEP STOP]

 

PLEASE HELP ME - My client is going to kill me and I dont want to die I am to young (and apperntly stupid)

 

 

 

Just for clarity I installed the NEW separate pricing per customer

Pixy

One day at a time - we all have to learn

Link to comment
Share on other sites

PLEASE HELP ME!!

I installed the package according to the instructions but now my front page says this:

1054 - Unknown column 'customers_group_id' in 'where clause'

 

select specials_new_products_price from specials where products_id = '1405' and status and customers_group_id = '0'

 

[TEP STOP]

 

And when I go to my customers via Admin it show this:

1146 - Table 'paperc_paperc_newoscomm.customers_groups' doesn't exist

 

select count(*) as total from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join customers_groups cg on c.customers_group_id = cg.customers_group_id

Did you run the sql file, sppc_v41_install.sql and if you did, check that all the changes are in the tables as they are supposed to. If parts didn't run, do them separately, e.g.
DROP TABLE IF EXISTS customers_groups;
CREATE TABLE customers_groups (
customers_group_id smallint UNSIGNED NOT NULL,
customers_group_name varchar(32) NOT NULL default '',
customers_group_show_tax enum('1','0') NOT NULL,
customers_group_tax_exempt enum('0','1') NOT NULL,
group_payment_allowed varchar(255) NOT NULL default '',
group_shipment_allowed varchar(255) NOT NULL default '',
PRIMARY KEY (customers_group_id)
);

Check it worked, then

INSERT INTO customers_groups VALUES('0','Retail','1','0','','');

and the error in the admin section should go away for instance.

Link to comment
Share on other sites

I did run the install file

but I am not good with sql and I am not sure where to put the Values in?

When I open the table there are 5 colums

Field Type Function Null and Value

I assume I have to put in by the value colum but it keeps giving me errors do I do the entire entry :

('0','Retail','1','0','',''); on one line?

eg I have a field customers_group_id do I put the entire line there?

 

 

I did run the install file

but I am not good with sql and I am not sure where to put the Values in?

When I open the table there are 5 colums

Field Type Function Null and Value

I assume I have to put in by the value colum but it keeps giving me errors do I do the entire entry :

('0','Retail','1','0','',''); on one line?

eg I have a field customers_group_id do I put the entire line there?

Pixy

One day at a time - we all have to learn

Link to comment
Share on other sites

Nobody here has psychic powers and therefore able to read your product_info.php file... Just wondering since product_info.php uses tep_get_products_special_price for getting the special price: did you change that (catalog/includes/functions/general.php):

 

catalog\includes\functions\general.php

Line 4

**AFTER**
$Id: general.php,v 1.231 2003/07/09 01:15:48 hpdl Exp $

**ADD**
adapted for Separate Pricing Per Customer v4.0 2005/02/08

Line 96

**REPLACE**
$product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status");

**WITH**
// BOF Separate Pricing Per Customer
 global $sppc_customer_group_id;

 if(!tep_session_is_registered('sppc_customer_group_id')) {
 $customer_group_id = '0';
 } else {
 $customer_group_id = $sppc_customer_group_id;
 }

	$product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status and customers_group_id = '" . (int)$customer_group_id . "'");
// EOF Separate_Pricing Per Customer

 

 

:thumbsup: Thank you. I was looking in the wrong place. I have checked that file and found the error. This contrib should be included with all OSC relaeses!!

 

2dogrc

Link to comment
Share on other sites

Hi,

 

I just installed SPPC 4.1.1 to a frash OSCommerce 2.2 MS2.

I followed the instructions to upload all files to their respective directories and ran the sppc_install.sql.

 

But a FATAL ERROS occured:

 

Fatal error: Call to undefined function: tep_array_merge() in /hsphere/local/home/hmiintl/edgesoundmachine.com/admin/configuration.php on line 93

I am not good at php. Anything I did wrong?

 

Thanks

 

Spencer

Link to comment
Share on other sites

Has anyone had problems with their SPPC group pricing dissapearing??

 

Last night I saw that of my 6 groups: Retail, prof1, prof2, wholesale1, wholesale2, wholesale3, wholesale4, all 4 wholesale groups were blank and poking in phpMyAdmin indeed they were gone.. I reuploaded all and they were back.. now tonight I look and wholesale1, 2 & 3 are gone..

 

Thinking back here.. last Friday I noticed that the products that should be hidden from the retail customers were not being hidden.. so that got wiped out also.. I reuploaded the store after manually setting a product as hidden and noting in phpMyAdmin what the column should have there (@, for NOT hidden and @,0 for hidden from retail).. that seems to be holding now and not dissapearing.

 

If I upload again with easy populate, the info is there.. it just seems to dissapear at will

 

I'm looking for clues as to where to hunt this problem down.. I'm not sure if it was one of the shipping modules or the small mods I installed yesterday.. Looking at the files I changed yesterday as to which files were origianlly altered by SPPC, I only see create_account.php in common here.. I just can't understand how an error there would delete the group prices of 3 or 4 groups at will..

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

More information on this disappearing group pricing..

 

I am loading up the products again and checking them randomly. everything looked good.

 

While that was going on I went into the customer list and was manually changing a few from retail to one of the professional pricing levels.. as I did this.. when I clicked save I would be returned to the customer list but the box to the right was not there.. the one that shows edit, delete, email, orders.. If I clicked on either a sort icon or another customer, the page refreshed and that box came back.

 

Now I go back into the products after this happened for the 3rd time and look at a product I know I just uploaded again and was correct before.. and guess what?? now I am missing the 3rd and 5th tier pricing I upgraded these 3 customers from group 0 (retail) to group 2 (prof2)

 

Obviously one of the mods seriously effected something here to do this.. I think the problem must be admin/customers.php

 

I'm printing every copy I have of this file and will have to compare line by line.. does anyone have any other suggestions??

Edited by wkdwich

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

does anyone have any other suggestions??

I guess you ran into the issue that I ran into and warned against in the PHP code (admin/customers.php starts around line 256):

 

// BOF Separate Pricing Per Customer
// Once all customers with a specific customers_group_id have been deleted from
// the table customers, the next time a customer is deleted, all entries in the table products_groups
// that have the (now apparently obsolete) customers_group_id will be deleted!
// If you don't want that, leave this section out, or comment it out
// Note that when customers groups are deleted from the table customers_groups, all the
// customers with that specific customer_group_id will be changed to customer_group_id = '0' (default/Retail)
$multiple_groups_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " ");
while ($group_ids = tep_db_fetch_array($multiple_groups_query)) {
 $multiple_customers_query = tep_db_query("select distinct customers_group_id from " . TABLE_CUSTOMERS . " where customers_group_id = " . $group_ids['customers_group_id'] . " ");
 if (!($multiple_groups = tep_db_fetch_array($multiple_customers_query))) {
tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $group_ids['customers_group_id'] . "'");
 }
}
// EOF Separate Pricing Per Customer

Link to comment
Share on other sites

I guess you ran into the issue that I ran into and warned against in the PHP code (admin/customers.php starts around line 256):

 

// that have the (now apparently obsolete) customers_group_id will be deleted!
// If you don't want that, leave this section out, or comment it out

 

wow.. you picked that up fast :)

 

looking this morning:

Licensed Professional 119

Prof - Unlicensed State/Country 93

Retail Consumer 29

Wholesale Tier4 1

Wholesale Tier2 1

 

Definately falls into your theory :)

 

I think I will leave the code and just leave "dummy accounts" in each group.

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

Spencer,

I followed the instructions to upload all files to their respective directories and ran the sppc_install.sql.

 

But a FATAL ERROS occured:

 

Fatal error: Call to undefined function: tep_array_merge() in /hsphere/local/home/hmiintl/edgesoundmachine.com/admin/configuration.php on line 93

I am not good at php. Anything I did wrong?

I've searched everywhere in the regular osC and in SPPC, but I can't find the function. There is an array_merge somewhere close (line 98)... you don't happen to use ms1?
Link to comment
Share on other sites

Spencer,

I've searched everywhere in the regular osC and in SPPC, but I can't find the function. There is an array_merge somewhere close (line 98)... you don't happen to use ms1?

 

Hi, JAnZ:

 

Thanks for your reply.

 

I am not sure but I did ask the tech support of my hosting comany. He told me it is 2.2 MS2.

So you mean the function only shown in MS1( of which file?) but not in MS2 version.

 

Can you tell me which file you looked into? I will call tech guy to verify it again.

 

thanks

 

Spencer :)

Link to comment
Share on other sites

I assume I have to put in by the value colum but it keeps giving me errors do I do the entire entry :

('0','Retail','1','0','',''); on one line?

You run that as an entire sql command:

INSERT INTO customers_groups VALUES('0','Retail','1','0','','');

If you do it manually, just enter the zero in the field for customers_group_id and Retail for the description. The next two values most likely will be set to 1 and 0 when a row is inserted in the table and the last two are empty values anyway, so need to bother with anything.

 

Spencer,

I am not sure but I did ask the tech support of my hosting comany. He told me it is 2.2 MS2.

So you mean the function only shown in MS1( of which file?) but not in MS2 version.

I was just guessing, since I can't find the function at all and since PHP has a function called array_merge, the tep_array_merge might have been in an old version of osCommerce and then subsequently replaced by the PHP version.
Can you tell me which file you looked into? I will call tech guy to verify it again.
I looked at the standard admin/configuration.php file (which is not changed by SPPC by the way). On the top of the file it should say (for a standard osC 2.2 MS2):

$Id: configuration.php,v 1.43 2003/06/29 22:50:51 hpdl Exp $

Link to comment
Share on other sites

Very strange, since this function is found in includes/classes/shopping_cart.php and should have been included when application_top.php was "called" or one of the other things that is included when that is loaded.

 

Try swapping your includes/classes/shopping_cart.php with your own and see if the error goes away. If so, look for the error in your own modified shopping_cart.php.

 

Thank you, Jan. I replaced the classes/shopping_cart.php with the previous version (before my backup) and all is well at the moment. One more question. On the Products Page in Admin. Where I go to edit the product information, it shows the new pricing field, however at the bottom this is showing up on the left side of the window:

 

1054 - Unknown column 'customers_group_name' in 'field list'

 

select distinct customers_group_id, customers_group_name from customers where customers_group_id != '0' order by customers_group_id

 

[TEP STOP]

 

 

The update and save buttons are not showing up.

 

Thank you, thank you for ALL your help.

 

 

Irish

Link to comment
Share on other sites

Irish,

One more question. On the Products Page in Admin. Where I go to edit the product information, it shows the new pricing field, however at the bottom this is showing up on the left side of the window:

 

1054 - Unknown column 'customers_group_name' in 'field list'

 

select distinct customers_group_id, customers_group_name from customers where customers_group_id != '0' order by customers_group_id

That is code from version 3 of SPPC. Not only is it ancient, it is full of bugs. You need to use version 4.1.1. The error arises from the fact that in version 3 the customers_group_name was in that table, but in version 4 it was moved to its own table.
Link to comment
Share on other sites

Hi, JAnZ:

 

Thanks for your reply.

 

I am not sure but I did ask the tech support of my hosting comany. He told me it is 2.2 MS2.

So you mean the function only shown in MS1( of which file?) but not in MS2 version.

 

Can you tell me which file you looked into? I will call tech guy to verify it again.

 

thanks

 

Spencer :)

 

Hi, JanZ:

 

Yes, I am running MS1 not MS2 after verifying with tech guy.

Any idea of how to update it to MS2? I know I will need to delete MS1 files (admin and catalog) before I instll the MS2, right?

 

Thanks

 

Spencer

Link to comment
Share on other sites

Spencer,

I've searched everywhere in the regular osC and in SPPC, but I can't find the function. There is an array_merge somewhere close (line 98)... you don't happen to use ms1?

Hi, JanZ:

 

I just read the instructions again. It is quoted as follows:

 

________________________________________________________________________________

_____

 

*Installation Scenarios*

 

This contribution has been written for osCommerce Milestone 2.2 It is unlikely that it will work with other versions of osCommerce. If you have a new installation of Milestone 2.2 then the easiest way to install this contribution is to upload the included files and run the spcc_v41_install.sql file on your MySql machine. After that modify the catalog\includes\languages\english\login.php file to include your 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. This is the preferred installation method due to ease/speed of installation

 

________________________________________________________________________________

______

 

It states for Milestone 2.2. It is supporse to be version 2.2 MS1 or ver. 2.2 MS2. I am confused.

I do exactly with instructions and this is the first contribution I installed from frash copy of osCommerce.

Before this,I did only face-liftng by modifing stylesheet.css and some images.

Why it gave me those fatal errors?

I appreciate your advise. I can't wait to add your contribution after I get over with this one.

 

Thanks

 

Spencer

Link to comment
Share on other sites

Spencer,

Yes, I am running MS1 not MS2 after verifying with tech guy.

Any idea of how to update it to MS2?

Since you started with a fresh copy I wouldn't bother updating from MS1 to MS2 but keep a copy of your changes in the style sheet, delete everything and start fresh with the MS2 update of November 13, do the sql for SPPC, upload the files for SPPC and continue. Staying with MS1 is not an option, you will find that 99% of the contributions will not work with it. If you insist on the upgrade path you can find more info in the Knowledge base.
Link to comment
Share on other sites

Spencer,

Since you started with a fresh copy I wouldn't bother updating from MS1 to MS2 but keep a copy of your changes in the style sheet, delete everything and start fresh with the MS2 update of November 13, do the sql for SPPC, upload the files for SPPC and continue. Staying with MS1 is not an option, you will find that 99% of the contributions will not work with it. If you insist on the upgrade path you can find more info in the Knowledge base.

 

 

Hi, JanZ:

 

Thanks for advise.

 

So I better upgrade it to MS2 for better contribution compatiablity, right?

 

Many tanks

 

Spencer

Link to comment
Share on other sites

Absolutely, 100% yes.

 

JanZ.

 

Thanks I am upgadig now manually.

I was working on some contributions for images, Easy-Populate, FEDEX realtime quote, and SPPC and encountered a lots of problems. It may be MS1 issue.

 

Thanks and will let you know how the thing going.

 

Spencer

Link to comment
Share on other sites

Jan, I fixed the 2 files that needed fixing. Thank you so much for your help... now it's off to get the CORRECT EP contribution and get these prices uploaded.

 

BTW.. you guys are awesome to put this contribution together.

 

Have a good holiday

 

Irish

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