Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error when creating New Product in Specials


spiderweb

Recommended Posts

Posted

Hello,

 

From the admin area after selecting Specials then selecting New Product I am getting the following error;

 

1146 - Table 'XXXXXX_XXXXXXX.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

select customers_group_name, customers_group_id from TABLE_CUSTOMERS_GROUPS order by customers_group_id

 

Could someone please tell me how I fix this?

 

Thanks

Posted
1146 - Table 'XXXXXX_XXXXXXX.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

TABLE_CUSTOMERS_GROUPS is a defined variable however the variable is being displayed as the actual text - not the variable it represents.

TABLE_CUSTOMERS_GROUPS should be displayed as 'customers_groups' which means that the variable is not being defined.

First take a look at the following page:

catalog/includes/database_tables.php

You should find something like:

define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');

 

Also I do not recognize this table in a default installation - which means to me that you have installed some contribution which should have created this table in your database.

It would not hurt to check your database and see if this table is there.

Look for the support topic concerning your contribution..

Lloyd

Posted

Hello,

 

I have try your suggestions but to no avail. The Specials we are using is the standard Oscommerce feature. I have looked at the files of another Oscommerce installation we have and all files are the same. I have compared the two databases and they appear to also be the same.

 

Any other suggestions.

 

Thanks

Posted

Look at your application_top page should be around Line 43

// define the project version

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

Lloyd

Posted

Yeah, that table is not in a default install of 2.2 - or any other that I know of.

 

You should do two things, first look at the database and see if you can find the table -

should be ''customers_groups',, the one thing that gets me is the error stating the name of the table as:

'XXXXXX_XXXXXXX.TABLE_CUSTOMERS_GROUPS'

 

I am not sure what the 'XXXXXX_XXXXXXX.' is about except that it is in the query.

Whatever - the 'TABLE_CUSTOMERS_GROUPS' is a defined constant and is not getting set. In a default install the db table constants are defined on page 'admin/includes/database_tables.php' for the Admin panel.. Check that page for something like

define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');

 

The other thing you should do is find the query that is causing the error. You could do a word search for 'TABLE_CUSTOMERS_GROUPS' on page 'catalog/admin/specials.php'

See what the query is stateing.

Lloyd

Posted

The XXXXXXX.XXXXXXX refers to the hosting username and the database name.

 

This is the only information I can see in the database

 

customers

customers_basket

customers_basket_attributes

customers_basket_text_attributes

customers_info

 

and this is what is in the database_tables.php file

 

define('TABLE_CUSTOMERS', 'customers');

define('TABLE_CUSTOMERS_BASKET', 'customers_basket');

define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');

define('TABLE_CUSTOMERS_INFO', 'customers_info');

 

I can find no reference to 'TABLE_CUSTOMERS_GROUPS' anywhere in the database, database_tables.php or specials.php

 

Here is the code for catalog/admin/specials.php

 

<?php

/*

$Id: specials.php,v 1.41 2003/06/29 22:50:52 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

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

 

if (tep_not_null($action)) {

switch ($action) {

case 'setflag':

tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);

 

tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL'));

break;

case 'insert':

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);

$specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);

$day = tep_db_prepare_input($HTTP_POST_VARS['day']);

$month = tep_db_prepare_input($HTTP_POST_VARS['month']);

$year = tep_db_prepare_input($HTTP_POST_VARS['year']);

 

if (substr($specials_price, -1) == '%') {

$new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$new_special_insert = tep_db_fetch_array($new_special_insert_query);

 

$products_price = $new_special_insert['products_price'];

$specials_price = ($products_price - (($specials_price / 100) * $products_price));

}

 

$expires_date = '';

if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {

$expires_date = $year;

$expires_date .= (strlen($month) == 1) ? '0' . $month : $month;

$expires_date .= (strlen($day) == 1) ? '0' . $day : $day;

}

 

tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1')");

 

tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));

break;

case 'update':

$specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']);

$products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);

$specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);

$day = tep_db_prepare_input($HTTP_POST_VARS['day']);

$month = tep_db_prepare_input($HTTP_POST_VARS['month']);

$year = tep_db_prepare_input($HTTP_POST_VARS['year']);

 

if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));

 

$expires_date = '';

if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {

$expires_date = $year;

$expires_date .= (strlen($month) == 1) ? '0' . $month : $month;

$expires_date .= (strlen($day) == 1) ? '0' . $day : $day;

}

 

tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");

 

tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id));

break;

case 'deleteconfirm':

$specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);

 

tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'");

 

tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));

break;

}

}

?>

<!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">

<script language="javascript" src="includes/general.js"></script>

<?php

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

?>

<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">

<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>

<?php

}

?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

<div id="popupcalendar" class="text"></div>

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<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 width="100%"><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_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<?php

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

$form_action = 'insert';

if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {

$form_action = 'update';

 

$product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");

$product = tep_db_fetch_array($product_query);

 

$sInfo = new objectInfo($product);

} else {

$sInfo = new objectInfo(array());

 

// create an array of products on special, which will be excluded from the pull down menu of products

// (when creating a new product on special)

$specials_array = array();

$specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");

while ($specials = tep_db_fetch_array($specials_query)) {

$specials_array[] = $specials['products_id'];

}

}

?>

<tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id', $HTTP_GET_VARS['sID']); ?>

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

<tr>

<td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?> </td>

<td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?> </td>

<td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> </td>

<td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="java script:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>

<td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

</tr>

</table></td>

</form></tr>

<?php

} else {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

</tr>

<?php

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";

$specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);

$specials_query = tep_db_query($specials_query_raw);

while ($specials = tep_db_fetch_array($specials_query)) {

if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {

$products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");

$products = tep_db_fetch_array($products_query);

$sInfo_array = array_merge($specials, $products);

$sInfo = new objectInfo($sInfo_array);

}

 

if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {

echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";

}

?>

<td class="dataTableContent"><?php echo $specials['products_name']; ?></td>

<td class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price']); ?></span></td>

<td class="dataTableContent" align="right">

<?php

if ($specials['status'] == '1') {

echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=0&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';

} else {

echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=1&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);

}

?></td>

<td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

</tr>

<?php

}

?>

<tr>

<td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">

<tr>

<td class="smallText" valign="top"><?php echo $specials_split->display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>

<td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>

</tr>

<?php

if (empty($action)) {

?>

<tr>

<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>

</tr>

<?php

}

?>

</table></td>

</tr>

</table></td>

<?php

$heading = array();

$contents = array();

 

switch ($action) {

case 'delete':

$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');

 

$contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm'));

$contents[] = array('text' => TEXT_INFO_DELETE_INTRO);

$contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

break;

default:

if (is_object($sInfo)) {

$heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added));

$contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified));

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));

$contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price));

$contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));

$contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');

 

$contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');

$contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));

}

break;

}

if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {

echo ' <td width="25%" valign="top">' . "\n";

 

$box = new box;

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

 

echo ' </td>' . "\n";

}

}

?>

</tr>

</table></td>

</tr>

</table></td>

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

</body>

</html>

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

 

 

I hope that is of some benefit to you. Thanks for your assistance in this matter.

Posted
The XXXXXXX.XXXXXXX refers to the hosting username and the database name.

 

So you put that there? OK..

 

The code from your page looks default - no changes I can see so that table is not being called from there. The only other pages I can think of that are being called are application top, column_left.php, and application_bottom.php which all create the admin pages.

 

Problem is classes and functions are being called as well. Can you do a word search thru your store for 'TABLE_CUSTOMERS_GROUPS' - it would help if you could find it. It has to be called from somewhere. It did not create itself.

 

Big problem is that you are saying the table is not in your database - plus like I said - I do not recall it being in any of osC's default configs. So -- did you install any contributions?? What were or did you do prior to this problem??

Lloyd

Posted

I designed the store and someone else customised it and added the contributions. Unfortuneately I have not been able to hold of them for sometime and I have been trying to solve this myself.

 

The contributions installed were;

Newsletter

Credit Card with CVV

imprint text options contribution

attribute sets contribution

 

I think that was all.

 

I have started going through the site starting in admin for 'TABLE_CUSTOMERS_GROUPS'. Do I need to check ALL files in the entire site?

Posted

You could check those contributions to see which one has that added constant - then just check or - restore to default those pages..

Bear in mind that since the constant pointed to a database table then there may be some changes there as well.

Which - since the database table was missing may be part of the problem - the database was not configured properly with the install.

 

Or check if any support forums exist for those contributions.. If the issue existed with anyone else..

 

Since the constant refers to customer groups, I would think that might refer to Newsletter.. Just a guess.

 

Or - the hardest - yes since you have an error in the admin that refers to a non-existant table then you should consider finding out where and what it does to the rest of the files..

Lloyd

Posted
http://www.oscommerce.com/community/contributions,1671

 

uses a table called "customers_groups".

 

Thank you Burt, that contribution was not mentioned - you may have saved the day!! Hopefully if that is the problem spider can find some support, fix the problem or restore those pages to default.

 

-- watch -- some of those other contributions edited same pages --

Lloyd

Posted

I have not found any sign of the Group Discount contribution being used that Burt suggested.

 

I have however looked closer at the suggestion of Lloyd that it may have something to do with the Newsletter. I have found the Newsletter Contribution being used which is "Newsletter v050". http://addons.oscommerce.com/info/535

 

I have not been able to download version V050, V051 or V052 so I have downloaded V053 to try and compare the files to see if this is causing the problem.

 

Any further advice is greatly appreciated as this is not my field.

 

Again thanks for all your help.

Posted
I have not found any sign of the Group Discount contribution being used that Burt suggested.

 

I have however looked closer at the suggestion of Lloyd that it may have something to do with the Newsletter. I have found the Newsletter Contribution being used which is "Newsletter v050". http://addons.oscommerce.com/info/535

 

I have not been able to download version V050, V051 or V052 so I have downloaded V053 to try and compare the files to see if this is causing the problem.

 

Any further advice is greatly appreciated as this is not my field.

 

Again thanks for all your help.

 

There is a table 'customers_groups' in the contribution 'GroupDiscount' v1.3 -

http://www.oscommerce.com/community/contributions,1671

Burt is right..

 

You can check 'catalog/admin/ for page - 'customers_groups.php' do you have that page??

 

I checked the 'Nesletter', contrib - did not find anything. Ill look at the rest as well.

Lloyd

Posted

I have checked all the contributions you listed and cannot find 'TABLE_CUSTOMERS_GROUPS ' in any of them.

 

Burt's suggestion is the only one that does have it.

 

'GroupDiscount v1.3'

 

However this contribution does not change the page -

'catalog/admin/specials.php'

Lloyd

Posted

What I am meaning is that a contribution (not necessarily the one I linked to) might have been installed - then uninstalled, but only partially removed.

 

I only linked to the contribution as I know that that particular contribution does use a table named "customers_groups" - I'm sure that many more contributions do too!

Posted

bottom line is that there is a query in your store that states:

 

'select customers_group_name, customers_group_id from TABLE_CUSTOMERS_GROUPS order by customers_group_id'

 

Find that query and you will be closer to solving the problem.

If your editing program can do a word search then try these words on the root directory:

TABLE_CUSTOMERS_GROUPS

customers_group_id

customers_group_name

 

One of them should turn it up. If you can find the query at least can get an idea whats going on and what happened.

If your program cannot do a word search then get another program.

 

Another option and since you are using an older version of osC - is to get rid of everything and start out with a fresh install.

Lloyd

Posted

I will do the word search on the root directory for:

TABLE_CUSTOMERS_GROUPS

customers_group_id

customers_group_name

 

and let you know.

 

Thanks again.

Posted

Hello,

 

I have found the following code in catalog/admin/includes/functions/general.php;

 

// BOF Separate Price Per Customer

$all_groups=array();

$customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");

while ($existing_groups = tep_db_fetch_array($customers_groups_query)) {

$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

}

// EOF Separate Price Per Customer

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");

while ($products = tep_db_fetch_array($products_query)) {

// BOF Separate Price Per Customer

/* if (!in_array($products['products_id'], $exclude)) {

$select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>'; */

if (!in_array($products['products_id'], $exclude)) {

$price_query=tep_db_query("select customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = " . $products['products_id']);

$product_prices=array();

while($prices_array=tep_db_fetch_array($price_query)){

$product_prices[$prices_array['customers_group_id']]=$prices_array['customers_group_price'];

}

reset($all_groups);

$price_string="";

$sde=0;

while(list($sdek,$sdev)=each($all_groups)){

if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {

if($sde)

$price_string.=", ";

$price_string.=$sdev.": ".$currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek]:$products['products_price']);

$sde=1;

}

}

$select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $price_string . ')</option>\n';

}

// EOF Separate Price Per Customer

 

 

I cannot find any reference to Separate Price Per Customer in the Admin of the store.

 

Should I remove this code?

 

Thanks once again for your help.

Posted
I have found the following code in catalog/admin/includes/functions/general.php;

 

Hurrah!

There should be a function call if it is on that page:

function () {

// BOF Separate Price Per Customer

$all_groups=array();

$customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");

while ($existing_groups = tep_db_fetch_array($customers_groups_query)) {

$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

}

 

If you delete anything it may cause errors anywhere else that function is called. You should do a function name search through the admin folder. Also check in the catalog/includes/functions/general.php page for the same change - the same function.

 

You now have the name of the contribution. 'Separate Price Per Customer'

 

Find the contribution and see which pages it has included then you can either read through the install page on it and reinstall db sql file - apparently since that db table is not in your db then it was never installed - do you need the contribution? If so then reinstall. If not then consider putting all pages affected back to default. A problem there may occur if any of your other contributions affected same pages. So that will need to be checked as well.

 

Whatever you do - I would get the contribution first and take a look at which pages were affected before I did anything else.

 

Put them back to default - be carfeful of other contribution changes on the same pages -

Or check that 'Separate Price Per Customer' is complete install - minus database changes - install contribution sql file

 

Good work!

Lloyd

Posted

I have found no other code nor do I have the contribution 'Separate Price Per Customer' installed.

 

I have been able to replace the code with the default code and YES all is now working correctly!

 

Thanks again for all your help, I greatly appreciate it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...