Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can someone please help me create a search function??


rustybolt

Recommended Posts

Hi Everyone

 

Okay im building at present a car parts site that i need to create a search function for.

There are two ways which i can see to tackle this however i dont have the ability to do so as i dont know coding very well.

 

I need an option on the front page that lets me search by make, ie: Audi, BMW, Citroen etc. I want it exactly like the manufacturers search box which drops down. I thought there maybe a way to duplicate the manufacturers part in admin and change this to model however having looked at whats involved im not sure unless someone can help advise.

 

I also need an option to search by model, ie: 318, 320, 325, M3 etc, this can come after the make was selected or as well as the make search just below in a custom box.

 

Ive seen a couple of sites made in OsCommerce that have a drop down box with makes and models in the same box, the makes are a darker colour to seperate them.

 

Is there an easy way to perform this function, either by adapting the manufacturer function or by using the advance search function perhaps.??

 

If some one can please help, advise it really will be appreciated i am totally stuck.

 

many thanks

 

Russel

Link to comment
Share on other sites

Drop downs that lead to other drop downs are the quickest way to get me to leave a website. However, I haven't used it, but I think this will do what you want:

 

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

 

There are probably others, so a search around the contributions would be a good idea.

 

Another way would be to create a lot of categories/sub-categories.

Link to comment
Share on other sites

Hi spax, thanks for the reply. Ive seen that contrib and its not what i need, although very similar to the function required.

 

I have many categories and sub-categories, however i need to be able to search by make and model to make it easier for customers, this function is very important to how the site works.

 

Example:

 

If you wanted to see all the the products for an Audi A3, you can choose a dropdown box in the left hand column to search the makes, then when youve choose audi, all the audi models are shown, then choose your model and all the products for that model are shown.

 

You can also navigate the site the normal way but like i said to be able to search all products just for you model this function will be better.

 

I presume its something to do with the advanced search function that will search the titles of all the products and list them. However i dont want the customer to have to type the model, i wanted a drop down list.

 

Any more advice?? Im baffled!

Link to comment
Share on other sites

Right here is something that someone hopefully can modify as im not too good with php!

 

this is a row of a drop down box which i have created, styled with CSS and when all the models are in it looks exactly like i want.

 

<tr>

<td><select size=1 name="product_model" class="mselect">

<option value="">Search Models:</option>

<option value="Chrysler" class="catrow" >Chrysler</option>

<option value="Chrysler~Neon" >Chrysler Neon</option>

<option value="Chrysler~PT Cruiser" >Chrysler Cruiser</option>

<option value="Chrysler~Voyager" >Chrysler Voyager</option>

<option value="Chrysler~300C" >Chrysler 300C</option>

</select></td>

</tr>

 

i have done this for most models, how can i have the model selected to be the used in the search function below, this code i have modified slightly from the original search box, ive just removed the advanced search link and text.

 

<TR>

<td>

<?php

$hide = tep_hide_session_id();

$info_box_contents = array();

$info_box_contents[] = array('form' => '<form name="quick_find" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',

'align' => 'center',

'text' => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"></a>'

);

new infoBox($info_box_contents);

?>

</TD>

</TR>

 

Can some PLEASE help me crack this, i have tried but dont know how to get the model into the php code so it will search for it in the Product titles. If someone can help i will create a contrib for this as i believe it will be a great addition to many a site.

 

Anyone help??

 

many thanks

 

Russel

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...