Hi there
I was trying to install the Products Extra Fields Contribution and when I try to pull up my shopping cart it gives me the following error:
Fatal error: Call to undefined function tep_db_query() in /data/15/1/86/50/1412702/user/1516832/htdocs/oscommerce/includes/database_tables.php on line 6
I am new to osCommerce and the only other contribution I have installed from my base install is STS.
The funny thing is everything works fine on the admin side, it's only the front end that I receive this error.
Here's the code I placed in database_tables.php (located at catalog/includes/database_tables.php)
<?php
// START: Extra Fields Contribution v2.0b - mintpeel display fix
$extra_fields_query = tep_db_query("
SELECT pef.products_extra_fields_order, pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
ON ptf.products_extra_fields_id=pef.products_extra_fields_id
WHERE ptf.products_id=". (int)$HTTP_GET_VARS['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."')
ORDER BY pef.products_extra_fields_order");
echo '<tr>
<td>
<table border="0" width="50%" cellspacing="0" cellpadding="2px">';
while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if (! $extra_fields['status']) // show only enabled extra field
continue;
echo'<tr><td class="main" align="left" valign="middle"><font size="1" color="#666666"><b>'.$extra_fields['name'].': </b>' . stripslashes($extra_fields['value']).'</font></td></tr>';
}
echo' </table>
</td>
</tr>';
// END: Extra Fields Contribution - mintpeel display fix
// START: Product Extra Fields
define('TABLE_PRODUCTS_EXTRA_FIELDS', 'products_extra_fields');
define('TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS', 'products_to_products_extra_fields');
// END: Product Extra Fields
?>
and this is the code at admin/includes/database_tables.php
<?php
/*
$Id: database_tables.php,v 1.1 2003/06/20 00:18:30 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
// define the database table names used in the project
define('TABLE_ADDRESS_BOOK', 'address_book');
define('TABLE_ADDRESS_FORMAT', 'address_format');
define('TABLE_BANNERS', 'banners');
define('TABLE_BANNERS_HISTORY', 'banners_history');
define('TABLE_CATEGORIES', 'categories');
define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');
define('TABLE_CONFIGURATION', 'configuration');
define('TABLE_CONFIGURATION_GROUP', 'configuration_group');
define('TABLE_COUNTRIES', 'countries');
define('TABLE_CURRENCIES', 'currencies');
define('TABLE_CUSTOMERS', 'customers');
define('TABLE_CUSTOMERS_BASKET', 'customers_basket');
define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');
define('TABLE_CUSTOMERS_INFO', 'customers_info');
define('TABLE_LANGUAGES', 'languages');
define('TABLE_MANUFACTURERS', 'manufacturers');
define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');
define('TABLE_NEWSLETTERS', 'newsletters');
define('TABLE_ORDERS', 'orders');
define('TABLE_ORDERS_PRODUCTS', 'orders_products');
define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes');
define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');
define('TABLE_ORDERS_STATUS', 'orders_status');
define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');
define('TABLE_ORDERS_TOTAL', 'orders_total');
define('TABLE_PRODUCTS', 'products');
define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');
define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');
define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');
define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');
define('TABLE_PRODUCTS_OPTIONS', 'products_options');
define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');
define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');
define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
define('TABLE_REVIEWS', 'reviews');
define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');
define('TABLE_SESSIONS', 'sessions');
define('TABLE_SPECIALS', 'specials');
define('TABLE_TAX_CLASS', 'tax_class');
define('TABLE_TAX_RATES', 'tax_rates');
define('TABLE_GEO_ZONES', 'geo_zones');
define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');
define('TABLE_WHOS_ONLINE', 'whos_online');
define('TABLE_ZONES', 'zones');
// BOF Product Extra Fields
define('TABLE_PRODUCTS_EXTRA_FIELDS', 'products_extra_fields');
define('TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS', 'products_to_products_extra_fields');
// EOF Product Extra Fields
?>
Please help as I am new computer programming and am really struggling with this.
Thanks so much
-Zack