Updating an older NAVBAR module to show manufacturers
Posted: Sat Sep 02, 2023 4:50 pm
I am trying to update an older NAVBAR module that shows a dropdown list of the stores manufacturers. I have the module installed and it works, but it throws a few errors. The first error is thrown I believe because of
I have added the full code below.
There may be more errors in there, but those are the two that I can see in the error logs for the site.
Is there anyone that can give me a bit of help, or at least a pointer, on how to cure the errors please. I have look in other modules for similar code but seem to be confusing myself.
on line 6 and the second is caused bytep_db_query
on line 11.tep_db_fetch_array
I have added the full code below.
Code: Select all
<li class="nav-item dropdown nb-manufacturers">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?= MODULE_NAVBAR_MANUFACTURERS_TEXT;?></a>
<?php
$manufacturers_list = '';
$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from manufacturers order by manufacturers_name");
// Display a list
$manufacturers_list = '<div class="dropdown-menu">';
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$manufacturers_name = $manufacturers['manufacturers_name'];
if (isset($_GET['manufacturers_id']) && ($_GET['manufacturers_id'] == $manufacturers['manufacturers_id'])) {
$manufacturers_name = '<strong>' . $manufacturers_name .'</strong>';
}
$manufacturers_list .= '<a class="dropdown-item" href="' . $GLOBALS['Linker']->build('index.php', 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a>';
}
$manufacturers_list .= '</div>';
echo $manufacturers_list;
?>
</li>Is there anyone that can give me a bit of help, or at least a pointer, on how to cure the errors please. I have look in other modules for similar code but seem to be confusing myself.