Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Searching by Manufacturer 2


Recommended Posts

I installed the Manufacturer 2 contributions, but I'd like to let my users search by Manufacturer2 as well. In advanced_search.php I added:

 

         <tr>
               <td class="fieldKey"><?php echo ENTRY_MANUFACTURERS2; ?></td>
               <td class="fieldValue"><?php echo tep_draw_pull_down_menu('manufacturers2_id', tep_get_manufacturers2(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS2)))); ?></td>
             </tr>

 

This resulted in an error on the page where the dropdown box would go. So I went ahead and added the following to application_top.php:

 

elseif (isset($HTTP_GET_VARS['manufacturers2_id'])) {
   $manufacturers2_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS2 . " where manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers2_id'] . "'");
   if (tep_db_num_rows($manufacturers2_query)) {
     $manufacturers2 = tep_db_fetch_array($manufacturers2_query);
     $breadcrumb->add($manufacturers2['manufacturers2_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id2=' . $HTTP_GET_VARS['manufacturers_id2']));
   }
 }

 

Now when you try to navigate to advanced_search.php, it does not load and the following error appears: Fatal error: Call to undefined function: tep_db_query() in /home3/www/world-motorsports/catalog/includes/boxes/manufacturers2.php on line 13. I tried defining the function, which result in the same error. I'm absolutely stuck here; I don't understand why it's failing.

 

I'm sorry for asking so many questions on here, but surely there must be a way to do this. I'm just trying to make a clone of the already existing Manufacturer drop down box and change it to Manufacturer2. I'm not by any means an experienced PHP coder, but I know if one box already exists, it must be possible to make a second. The reason our company switched from ZenCart to osC was because of the larger user base on the forums and the number of contributions. I wasn't getting any help on their forums, and I'm not getting much help here either.

Shawn Pauley

WORLD Motorsports

Link to comment
Share on other sites

I opened manufacturers.php and manufacturers2.php in a text editor side by site, and I noticed that they are identical, except in manufacturers2.php everything was changed to manufacturers2. So at the top of the script we have:

 

 $manufacturers2_query = tep_db_query("select manufacturers2_id, manufacturers2_name from " . TABLE_manufacturers2 . " order by manufacturers2_name");
 if ($number_of_rows = tep_db_num_rows($manufacturers2_query)) {

 

And at the top of manufacturers.php we have:

 

  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
 if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {

 

Identical. But only manufacturer2.php is causing the error. Is $manufcaturers_query defined somewhere else, and if so, where? How can I define $manufacturers2_query so I no longer get this fatal error?

Shawn Pauley

WORLD Motorsports

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