roughrider Posted January 18, 2009 Share Posted January 18, 2009 I have the Product Price Updater contrib (http://www.oscommerce.com/community/contributions,2014) which has worked great for months then out of the blue, parts of the page are missing. Please see attached file. I've reinstalled this contrib and spent hours tryng to find out why this should suddenly happen. Please can someone help me as I'm stuffed without it having over 130k products that need regular price updates. Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted January 18, 2009 Share Posted January 18, 2009 Posting the code might help Quote Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
roughrider Posted January 18, 2009 Author Share Posted January 18, 2009 <?php /* $Id: price_updater.php,v 1.1 2004/04/18 jck Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // Functions to fill the dropdown boxes function tep_get_manufacturers($manufacturers_array = '') { // Function borrowed from the Catalog side if (!is_array($manufacturers_array)) $manufacturers_array = array(); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } return $manufacturers_array; } function tep_get_categories($categories_array = '') { // Function modified from tep_get_manufacturers() global $language; if (!is_array($categories_array)) $categories_array = array(); $categories_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_LANGUAGES . " l WHERE l.languages_id = cd.language_id AND l.name = '" . $language . "' ORDER BY categories_name" ); while ($categories = tep_db_fetch_array($categories_query)) { $categories_array[] = array('id' => $categories['categories_id'], 'text' => $categories['categories_name']); } return $categories_array; } function tep_get_models($models_array = '') { // Function modified from tep_get_manufacturers() global $language, $first, $last; if (!is_array($models_array)) $models_array = array(); $models_query = tep_db_query("SELECT products_id, products_model FROM " . TABLE_PRODUCTS . " ORDER BY products_model" ); $count = 0; while ($models = tep_db_fetch_array($models_query)) { if ($count == 0) { $first = $models['products_model']; } $models_array[] = array('id' => $models['products_model'], 'text' => $models['products_model']); $count++; $last = $models['products_model']; } return $models_array; } $models_array = tep_get_models(); $from = $first; $to = $last; // Process the request data if (isset($_GET['action']) && $_GET['action'] == 'update') { // Get the data from the form and sanitize it if (isset($_POST['manufacturers_id'])) { $mfr = (int)$_POST['manufacturers_id']; } else { $mfr = 0; } if (isset($_POST['categories_id'])) { $cat = (int)$_POST['categories_id']; } else { $cat = 0; } if (isset($_POST['from_id'])) { $from = $_POST['from_id']; } if (isset($_POST['to_id'])) { $to = $_POST['to_id']; } if (isset($_POST['like'])) { $like = $_POST['like']; } else { $like = ''; } if (isset($_POST['add'])) { $add = (int)$_POST['add']; } else { $add = 1; } if (isset($_POST['fixed'])) { $fixed = (int)$_POST['fixed']; } else { $fixed = 1; } if (isset($_POST['value'])) { $value = ereg_replace('[^0-9.]', '', $_POST['value']); } else { $value = 0; } // Set the SQL where function if ($mfr == 0) { if ($cat == 0) { $where_string = ''; } else { $where_string = ' AND pcat.categories_id = ' . $cat; } } else { $where_string = ' AND manufacturers_id=' . $mfr; if ($cat != 0) { $where_string .= ' AND pcat.categories_id = ' . $cat; } } if ($like == '') { if ($from != $first) { $where_string .= " AND p.products_model >= '" . $from . "'"; } if ($to != $last) { $where_string .= " AND p.products_model <= '" . $to . "'"; } } else { $where_string .= " AND p.products_model LIKE '" . $like . "'"; } // Query to get the selected products and make the changes $sql_string = 'SELECT DISTINCT p.products_id AS id, p.products_price AS price FROM ' . TABLE_PRODUCTS . ' p, ' . TABLE_PRODUCTS_TO_CATEGORIES . ' pcat WHERE p.products_id = pcat.products_id' . $where_string; $products_update_query = tep_db_query($sql_string); $count = 0; while ($products_update = tep_db_fetch_array($products_update_query)) { if ($fixed == 0) { // Fixed price change if ($add == 0) { // Subtract $new_price = $products_update['price'] - $value; } else { // Add $new_price = $products_update['price'] + $value; } } else { // Percent change if ($add == 0) { // Subtract $new_price = $products_update['price'] * (1 - ($value / 100)); } else { // Add $new_price = $products_update['price'] * (1 + ($value / 100)); } } tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_price='" . $new_price . "' WHERE products_id='" . $products_update['id'] . "'" ); $product_attributes_query = tep_db_query("select products_attributes_id, options_values_price from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_update['id'] . "'"); while ($product_attributes = tep_db_fetch_array($product_attributes_query) ) { if ($fixed == 0) { // Fixed price change if ($add == 0) { // Subtract $new_price = $product_attributes['options_values_price'] - $value; } else { // Add $new_price = $product_attributes['options_values_price'] + $value; } } else { // Percent change if ($add == 0) { // Subtract $new_price = $product_attributes['options_values_price'] * (1 - ($value / 100)); } else { // Add $new_price = $product_attributes['options_values_price'] * (1 + ($value / 100)); } } tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $new_price . "' where products_attributes_id = '" . $product_attributes['products_attributes_id'] . "'"); } // end insert product attributes $count++; } // Products while loop // If a manufacturer was selected, get the name if ($mfr != 0) { $manufacturers_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id=" . $mfr); $manufacturers = tep_db_fetch_array($manufacturers_query); $manufacturer = $manufacturers['manufacturers_name']; } else { $manufacturer = TEXT_ALL_MANUFACTURERS; } // If a category was selected, get the name if ($cat != 0) { $categories_query = tep_db_query("SELECT cd.categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_LANGUAGES . " l WHERE l.languages_id = cd.language_id AND l.name = '" . $language . "' AND categories_id = " . $cat); $categories = tep_db_fetch_array($categories_query); $category = TEXT_THE . $categories['categories_name'] . TEXT_CATEGORY; } else { $category = TEXT_ALL_CATEGORIES; } // Finish the rest of the update text information $fixed_string = ''; if ($fixed == 1) { $fixed_string = TEXT_PERCENT; } $add_string = TEXT_DECREASED_BY; if ($add == 1) { $add_string = TEXT_INCREASED_BY; } $update_string = $manufacturer . TEXT_PRICES_IN . $category . TEXT_WERE . $add_string . $value . $fixed_string; } // End action=update ?> <!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> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <!-- 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><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading">Product Price Updater</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> <tr> <td> <table border=0 width=700 cellspacing=0 cellpadding=5> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_UPDATES; ?> </td> </tr> <tr class="dataTableRow"> <td class="dataTableContent"> <?php if (isset($count) && $count != 0) { echo $update_string; } ?> </td> </tr> <tr class="dataTableRow"> <td class="dataTableContent"> <?php if (isset($count) && $count != 0) { echo $count; } else { echo TEXT_NO; } echo TEXT_PRODUCTS_UPDATED; ?> </td> </tr> </table> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', "100%", 20); ?></td> </tr> <tr> <td> <form action="price_updater.php?action=update" method=post> <table border=0 width=700 cellspacing=0 cellpadding=2> <tr> <td colspan=7><?php echo tep_black_line(); ?></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_MANUFACTURER; ?> </td> <td colspan=2 class="dataTableHeadingContent"> <?php echo TABLE_HEADING_CATEGORY; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PLUS_MINUS; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_FIXED; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_VALUE; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <tr> <td colspan=7><?php echo tep_black_line(); ?></td> </tr> <tr class=attributes-odd> <td class="smallText"> <?php echo tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '0', 'text' => 'All Manufacturers ')))); ?> </td> <td colspan=2 class="smallText"> <?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '0', 'text' => 'All Categories ')))); ?> </td> <td class="smallText"> <?php echo tep_draw_pull_down_menu('add', array(array('id' => '1', 'text' => '+'), array('id' => '0', 'text' => '-'))); ?> </td> <td class="smallText"> <?php echo tep_draw_pull_down_menu('fixed', array(array('id' => '1', 'text' => '%'), array('id' => '0', 'text' => 'Fixed'))); ?> </td> <td class="smallText"> <?php echo tep_draw_input_field('value', "0"); ?> </td> <td class="smallText"> <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> </td> </tr> <tr> <td colspan=7><?php echo tep_black_line(); ?></td> </tr> <tr> <td colspan=7><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> <tr> <td colspan=7><?php echo tep_black_line(); ?></td> </tr> <tr class="dataTableHeadingRow"> <td colspan=7 class="dataTableHeadingContent"> <?php echo TABLE_HEADING_MODEL; ?> </td> </tr> <tr> <td colspan=7><?php echo tep_black_line(); ?></td> </tr> <tr class=attributes-odd> <td class="smallText"> <?php echo tep_draw_pull_down_menu('from_id', $models_array, $from); ?> <?php echo TEXT_TO ?> </td> <td class="smallText"> <?php echo tep_draw_pull_down_menu('to_id', $models_array, $to); ?> </td> <td class="smallText"> Like: </td> <td colspan=4 class="smallText"> <?php echo tep_draw_input_field('like', ""); ?> <?php echo TEXT_NOTES ?> </td> </tr> <tr> <td colspan=7><?php echo tep_black_line(); ?></td> </tr> </table> </form> </td> </tr> </table></td> </tr> </table> </body> </html> Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
roughrider Posted January 18, 2009 Author Share Posted January 18, 2009 As I think you can see, everything seems ok with the code and like I said, I've reinstalled both priceupdater php pages and tried using the backup files I had from yonks ago, nothing seems to fix it. There must be something else blocking these parts. Got to be something simple as these things so often are but it's thrown me and I'm far from a novice!! What am I to do.... panick!! Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 18, 2009 Share Posted January 18, 2009 That's an older version of the code, but it should still work. It's working on my site, so it shouldn't be an osCommerce or PHP version issue. It looks like something external is failing; possibly tep_get_categories()? Have you looked at the HTML? Go do a View Source and look for hidden error messages. If there's nothing obvious, post the code here and we'll give it a try. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 18, 2009 Author Share Posted January 18, 2009 Thanks Jim I can't see anything but then I don't know what I'm looking for. Have posted source but removed the dropdown options for manufactures & catagories as they're huge <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html dir="ltr" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>osCommerce</title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <!-- header //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/oscommerce.gif" border="0" alt="osCommerce" title=" osCommerce " width="204" height="50"></td> <td align="right"><a href="http://www.oscommerce.com" target="_blank"><img src="images/header_support.gif" border="0" alt="Support Site" title=" Support Site " width="50" height="50"></a> <a href="http://motorcycleproducts.co.uk/catalogue/"><img src="images/header_checkout.gif" border="0" alt="Online Catalog" title=" Online Catalog " width="53" height="50"></a> <a href="http://motorcycleproducts.co.uk/catalogue/admin/index.php"><img src="images/header_administration.gif" border="0" alt="Administration" title=" Administration " width="50" height="50"></a> </td> </tr> <tr class="headerBar"> <td class="headerBarContent"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/index.php" class="headerLink">Administration</a></td> <td class="headerBarContent" align="right"><a href="http://www.oscommerce.com" class="headerLink">Support Site</a> | <a href="http://motorcycleproducts.co.uk/catalogue/" class="headerLink">Online Catalog</a> | <a href="http://motorcycleproducts.co.uk/catalogue/admin/index.php" class="headerLink">Administration</a> </td> </tr> </table><!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="125" valign="top"><table border="0" width="125" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <!-- configuration //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/configuration.php?gID=1&selected_box=configuration'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/configuration.php?gID=1&selected_box=configuration" class="menuBoxHeadingLink">Configuration</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- configuration_eof //--> <!-- catalog //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/categories.php?selected_box=catalog'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/categories.php?selected_box=catalog" class="menuBoxHeadingLink">Catalog</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxContent"><a href="http://motorcycleproducts.co.uk/catalogue/admin/categories.php" class="menuBoxContentLink">Categories/Products</a><br><a href="http://motorcycleproducts.co.uk/catalogue/admin/manufacturers.php" class="menuBoxContentLink">Manufacturers</a><br><a href="http://motorcycleproducts.co.uk/catalogue/admin/specials.php" class="menuBoxContentLink">Specials</a><br><a href="http://motorcycleproducts.co.uk/catalogue/admin/price_updater.php" class="menuBoxContentLink">Price Updater</a></td> </tr> </table> </td> </tr> <!-- catalog_eof //--> <!-- modules //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/modules.php?set=payment&selected_box=modules'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/modules.php?set=payment&selected_box=modules" class="menuBoxHeadingLink">Modules</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- modules_eof //--> <!-- customers //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/customers.php?selected_box=customers'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/customers.php?selected_box=customers" class="menuBoxHeadingLink">Customers</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- customers_eof //--> <!-- taxes //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/countries.php?selected_box=taxes'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/countries.php?selected_box=taxes" class="menuBoxHeadingLink">Locations / Taxes</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- taxes_eof //--> <!-- localization //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/currencies.php?selected_box=localization'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/currencies.php?selected_box=localization" class="menuBoxHeadingLink">Localization</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- localization_eof //--> <!-- reports //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/stats_products_viewed.php?selected_box=reports'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/stats_products_viewed.php?selected_box=reports" class="menuBoxHeadingLink">Reports</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- reports_eof //--> <!-- tools //--> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="menuBoxHeading" onmouseover="this.style.cursor='hand'" onclick="document.location.href='http://motorcycleproducts.co.uk/catalogue/admin/backup.php?selected_box=tools'"> <a href="http://motorcycleproducts.co.uk/catalogue/admin/backup.php?selected_box=tools" class="menuBoxHeadingLink">Tools</a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> </table> </td> </tr> <!-- tools_eof //--> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading">Product Price Updater</td> <td class="pageHeading" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="75"></td> </tr> </table></td> </tr> <tr> <td> <table border=0 width=700 cellspacing=0 cellpadding=5> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> Status </td> </tr> <tr class="dataTableRow"> <td class="dataTableContent"> </td> </tr> <tr class="dataTableRow"> <td class="dataTableContent"> No products were updated. </td> </tr> </table> </td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="20"></td> </tr> <tr> <td> <form action="price_updater.php?action=update" method=post> <table border=0 width=700 cellspacing=0 cellpadding=2> <tr> <td colspan=7><img src="images/pixel_black.gif" border="0" alt="" width="100%" height="1"></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> Manufacturer </td> <td colspan=2 class="dataTableHeadingContent"> Category </td> <td class="dataTableHeadingContent"> +/- </td> <td class="dataTableHeadingContent"> Fixed/% </td> <td class="dataTableHeadingContent"> Value </td> <td class="dataTableHeadingContent"> Action </td> </tr> <tr> <td colspan=7><img src="images/pixel_black.gif" border="0" alt="" width="100%" height="1"></td> </tr> <tr class=attributes-odd> <td class="smallText"> <select name="manufacturers_id" size="1"><option value="0">All Manufacturers</option></select> </td> <td colspan=2 class="smallText"> <select name="categories_id" size="1"> <option>All Categories</option></select> Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 18, 2009 Share Posted January 18, 2009 It appears that you removed the important part. The categories list is messing up, or it's hanging somewhere in the list. The problem is either with tep_get_categories() or with something that it uses. tep_get_categories() is near the top of the page, Lines 25-40. Now that I look at it, that query is wrong. Try replacing Lines 28-35 with this: $categories_query = tep_db_query("SELECT cd.categories_id, cd.categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_LANGUAGES . " l WHERE l.languages_id = cd.language_id AND l.name = '" . $language . "' ORDER BY categories_name" ); If that doesn't work, check your database tables for corruption. This function uses the categories_description and languages tables. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 18, 2009 Author Share Posted January 18, 2009 That didn't help Jim, now I'm really scared!! How do I find out if a table is damaged? I don't want to run the risk of "repair table" :( Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 18, 2009 Share Posted January 18, 2009 Backup your database first, no matter what you do. Then you can get everything back if something goes wrong. Then run check table. If that says everything is OK, the problem is elsewhere. I don't see how, but check anyway. If the table is corrupted, you'll have to try repair table. I've run this many times with no problems. I recently ran a repair on the entire database for four stores without a problem (The host messed up an upgrade on the server.) This doesn't mean it's foolproof, but the chances of borking your database are low. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 18, 2009 Author Share Posted January 18, 2009 MotorcycleProducts.categories_description check status OK MotorcycleProducts.languages check status OK no errors it seems Jim Any other ideas? Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 19, 2009 Share Posted January 19, 2009 Now I'm really puzzled. This is a fairly simple bit of code that's quite self-contained. I just can't see where it's messing up. Since you have a backup, go run repair table anyway. If it still doesn't work. please post the HTML output from the beginning of the Categories pulldown to the end of the file. It has to be in there somewhere. If you can get a look at your server error logs, that would help a lot. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥kymation Posted January 19, 2009 Share Posted January 19, 2009 Now I'm really puzzled. This is a fairly simple bit of code that's quite self-contained. I just can't see where it's messing up. Since you have a backup, go run repair table anyway. If it still doesn't work. please post the HTML output from the beginning of the Categories pulldown to the end of the file. It has to be in there somewhere. If you can get a look at your server error logs, that would help a lot. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥kymation Posted January 19, 2009 Share Posted January 19, 2009 (edited) Please disregard. Jim Edited January 19, 2009 by kymation Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 19, 2009 Author Share Posted January 19, 2009 Ok I've done a repair on both tables, no problem. I've looked at my error logs and thousands of errors (575mb) but all down to the popup image "Lightbox" contrib. Basically it looks like whenever anyone clicks a product image to enlarge, I get a ,,, "File does not exist: mywebsite.com/lightbox/images, referer: mywebsite.com/product.html line in my log. All works ok though but it's something else I need to look at. (It never rains but it ***** down :blink: ) And here is a bit of the source you requested Jim.. <td colspan=2 class="smallText"> <select name="categories_id"><option value="0">All Categories</option><option value="3334"></option> Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
roughrider Posted January 19, 2009 Author Share Posted January 19, 2009 Hey Jim As an afterthought, I just change the code to your original of 12th April 2004 And look what I get... Does it say anything new to you? Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 20, 2009 Share Posted January 20, 2009 The older version doesn't have the Categories pulldown, so it will probably work just fine. This is still pointing to something in your categories, I just don't know what. Have you added a new category recently, or have you edited a category title? Maybe some special character in a title is borking the pulldown code. I can't think of anything else that would have this effect. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 20, 2009 Author Share Posted January 20, 2009 Jim I've checked the catagory names & model numbers that I was adding when this problem was first noticed and there is nothing unusual that I can see. But I've been having a go at the code and got it now like this The only lines of coding stopping this now from working fully is this... <td class="smallText"> <?php echo tep_draw_pull_down_menu('from_id', $models_array, $from); ?> <?php echo TEXT_TO ?> </td> <td class="smallText"> <?php echo tep_draw_pull_down_menu('to_id', $models_array, $to); ?> </td> Really appreciate all the help you've given me Jim Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 21, 2009 Share Posted January 21, 2009 I don't know what you've done to fix the Categories list, so I'm unable to do any more with this. Whatever you did, try to apply that to the other pulldown lists. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 22, 2009 Author Share Posted January 22, 2009 All I've done Jim is remove those 2 lines of code. It's something to do with "$models_array" but what?? Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 22, 2009 Share Posted January 22, 2009 That's another pulldown array, similar to the Categories and Manufacturers arrays. If that's what is failing, check the Products table for errors. You should also reload the language files from the distribution file, just in case one has been corrupted. That's all I can think of. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
roughrider Posted January 22, 2009 Author Share Posted January 22, 2009 Sorry jim not sure what you mean "load :blush: language files from the distribution file" Quote Ride It Like You Stole It Link to comment Share on other sites More sharing options...
♥kymation Posted January 23, 2009 Share Posted January 23, 2009 catalog/admin/includes/languages/english.php and catalog/admin/includes/languages/english/price_updater.php. Corruption in those files can sometimes cause problems like this. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.