chrometweaks.org

iPage for domain name registration for 10 years ?

Click Here To View All Answers...


First question I got is iPage for domain name registration for 10 years ? Hoping for any response. My other question... I'm develping a store for selling DVD's. I have added many new fields which I would like to be able to search, in advanced_search.php. I have added fields for actors, director, length, audio, video, region and some more to the database that are now being displayed in product_info.php.... Now I want to search the database for a specific director..

I have really searched for and scanned through the forums but couldn't find any really concrete help in achieving this. Most answers seem to be to just use 'search in description' but that's not an option I'm afraid, I must have new searchable input fields.....

I know it can be done, but as usual my php and oscommerce skills aren't really that great so the best I've done so far is a bunch of errors!!.

Has anyone added more input fields in 'advance_search.php' ?

Comments (139)

I'm stumped. I'm not so sure what is the right answer to your question. I'll do some poking around and get back to you if I discover an decent answer. You should email the people at iPage as they probably know..

Comment #1

A simple solution would be like so..

Find this line in your advanced_search_results.php and add your new fields in..

$where_str .= "(pd.products_name like '%"tep_db_input($keyword)"%' or.

$where_str .= "(pd.mynewfield like '%"tep_db_input($keyword)"%' or.

Pd.products_name like '%"tep_db_input($keyword)"%' or.

If you put those fields in products and not products_description then use p. instead of pd..

Obviously you can do a lot more things there, checkbox. dropdown, etc..

This post has been edited by.

User99999999.

: 21 March 2004, 07:04..

Comment #2

Ah, oue oue!!.

Although not really what I was looking for, but it sure is good start, thank you very much! Now I'm able to search my new fields at least!.

How hard would it be to add a input field in advanced_search.php for lets say the field for directors (p.products_director) so I can search only one databasefield at a time?.

Thanks again!!..

Comment #3

Hm... I've tried to duplicate the "keywords" main search input field and it's functions in 'advanced_search.php" and "advanced_searchresults". I basically added a '2' after all occurencies of "keyword" and "keywords" to try to separate them from eachother. Both search fields actually shows and I get no errors when trying to search, however I get no results at all? Well, I am surprised I got no errors anyway!! Hm... anyone?..

Comment #4

OK.

I will try....

Put this in advanced_search.php.

<tr>.

 <td class="fieldKey"><?php echo 'Director'; ?></td>.

 <td class="fieldValue"><?php echo tep_draw_input_field('products_director'); ?></td>.

</tr>.

Find this in advanced_search_results.php.

If (isset($HTTP_GET_VARS['keywords'])) {.

 $keywords = $HTTP_GET_VARS['keywords'];.

}.

Then append your fields to $keywords....

If (isset($HTTP_GET_VARS['keywords'])) {.

 $keywords = $HTTP_GET_VARS['keywords'];.

}.

If (isset($HTTP_GET_VARS['products_director])) {.

 $keywords .= $HTTP_GET_VARS['products_director'];.

}..

Comment #5

And ofcourse you need to modify the SQL like above '$where_str'..

Comment #6

Thanks again Dave, thanks!!!!!.

Will try that right away!!..

Comment #7

But ofcourse, I'm stuck.....

Is this correct?.

 if (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

   $where_str .= " and p.products_director = '"(int)$HTTP_GET_VARS['products_director']"'";.

 }.

When I do a search it seems to ignore my directors field?!..

Comment #8

Wiiiii! I managed to sort it out myself. Forgot to add alot of code, now it works!!.

Thanks!.

This post has been edited by.

Lone_fox.

: 21 March 2004, 10:41..

Comment #9

Well only partially....

When I added the new directors field and tried to search and I saw som results I thought everything was ok, but nope!.

I can now ONLY search using the search box to the left AND the new directors field. Although it seems like it won't even search my directors databasefields, I get the same results as when searching using the search box, only searching for product names that is. All other fields in advanced_search.php don't even get registered, it's like they're blank when I try to search using them..

???.

Here's the code in advanced_search_result.php.

<?php.

/*.

 $Id: advanced_search_result.php,v 1.72 2003/06/23 06:50:11 project3000 Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

 require('includes/application_top.php');.

 require(DIR_WS_LANGUAGES$language'/'FILENAME_ADVANCED_SEARCH);.

 $error = false;.

 if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&.

      (isset($HTTP_GET_VARS['products_director']) && empty($HTTP_GET_VARS['products_director'])) &&.

      (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&.

      (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&.

      (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&.

      (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {.

   $error = true;.

   $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);.

 } else {.

   $dfrom = '';.

   $dto = '';.

   $pfrom = '';.

   $pto = '';.

   $keywords = '';.

   $products_director = '';.

   if (isset($HTTP_GET_VARS['dfrom'])) {.

     $dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);.

   }.

   if (isset($HTTP_GET_VARS['dto'])) {.

     $dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);.

   }.

   if (isset($HTTP_GET_VARS['pfrom'])) {.

     $pfrom = $HTTP_GET_VARS['pfrom'];.

   }.

   if (isset($HTTP_GET_VARS['pto'])) {.

     $pto = $HTTP_GET_VARS['pto'];.

   }.

   if (isset($HTTP_GET_VARS['keywords'])) {.

     $keywords = $HTTP_GET_VARS['keywords'];.

   }.

   if (isset($HTTP_GET_VARS['products_director'])) {.

     $keywords = $HTTP_GET_VARS['products_director'];.

   }.

   $date_check_error = false;.

   if (tep_not_null($dfrom)) {.

     if (!tep_checkdate($dfrom, DOB_FORMAT_STRING, $dfrom_array)) {.

       $error = true;.

       $date_check_error = true;.

       $messageStack->add_session('search', ERROR_INVALID_FROM_DATE);.

     }.

   }.

   if (tep_not_null($dto)) {.

     if (!tep_checkdate($dto, DOB_FORMAT_STRING, $dto_array)) {.

       $error = true;.

       $date_check_error = true;.

       $messageStack->add_session('search', ERROR_INVALID_TO_DATE);.

     }.

   }.

   if (($date_check_error == false) && tep_not_null($dfrom) && tep_not_null($dto)) {.

     if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {.

       $error = true;.

       $messageStack->add_session('search', ERROR_TO_DATE_LESS_THAN_FROM_DATE);.

     }.

   }.

   $price_check_error = false;.

   if (tep_not_null($pfrom)) {.

     if (!settype($pfrom, 'double')) {.

       $error = true;.

       $price_check_error = true;.

       $messageStack->add_session('search', ERROR_PRICE_FROM_MUST_BE_NUM);.

     }.

   }.

   if (tep_not_null($pto)) {.

     if (!settype($pto, 'double')) {.

       $error = true;.

       $price_check_error = true;.

       $messageStack->add_session('search', ERROR_PRICE_TO_MUST_BE_NUM);.

     }.

   }.

   if (($price_check_error == false) && is_float($pfrom) && is_float($pto)) {.

     if ($pfrom >= $pto) {.

       $error = true;.

       $messageStack->add_session('search', ERROR_PRICE_TO_LESS_THAN_PRICE_FROM);.

     }.

   }.

   if (tep_not_null($keywords)) {.

     if (!tep_parse_search_string($keywords, $search_keywords)) {.

       $error = true;.

       $messageStack->add_session('search', ERROR_INVALID_KEYWORDS);.

     }.

   }.

   if (tep_not_null($products_director)) {.

     if (!tep_parse_search_string($products_director, $search_products_director)) {.

       $error = true;.

       $messageStack->add_session('search', ERROR_INVALID_products_director);.

     }.

   }.

 }.

 if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords) && empty($products_director)) {.

   $error = true;.

   $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);.

 }.

 if ($error == true) {.

   tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));.

 }.

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));.

 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false));.

?>.

<!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; ?>">.

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER)DIR_WS_CATALOG; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="stylesheet.css">.

</head>.

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">.

<! header //>.

<?php require(DIR_WS_INCLUDES'header.php'); ?>.

<! header_eof //>.

<! body //>.

<table border="0" width="100%" cellspacing="3" cellpadding="3">.

 <tr>.

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">.

<! 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="0">.

     <tr>.

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">.

         <tr>.

           <td class="pageHeading"><?php echo HEADING_TITLE_2; ?></td>.

           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES'table_background_browse.gif', HEADING_TITLE_2, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>.

         </tr>.

       </table></td>.

     </tr>.

     <tr>.

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>.

     </tr>.

     <tr>.

       <td>.

<?php.

// create column list.

 $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,.

                      'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

                      'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

                      'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

                      'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,.

                      'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                      'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                      'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

 asort($define_list);.

 $column_list = array();.

 reset($define_list);.

 while (list($key, $value) = each($define_list)) {.

   if ($value > 0) $column_list[] = $key;.

 }.

 $select_column_list = '';.

 for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {.

   switch ($column_list[$i]) {.

     case 'PRODUCT_LIST_MODEL':.

       $select_column_list .= 'p.products_model, ';.

       break;.

     case 'PRODUCT_LIST_MANUFACTURER':.

       $select_column_list .= 'm.manufacturers_name, ';.

       break;.

     case 'PRODUCT_LIST_QUANTITY':.

       $select_column_list .= 'p.products_quantity, ';.

       break;.

     case 'PRODUCT_LIST_IMAGE':.

       $select_column_list .= 'p.products_image, ';.

       break;.

     case 'PRODUCT_LIST_WEIGHT':.

       $select_column_list .= 'p.products_weight, ';.

       break;.

   }.

 }.

 $select_str = "select distinct "$select_column_list" m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";.

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {.

   $select_str .= ", SUM(tr.tax_rate) as tax_rate ";.

 }.

 $from_str = "from "TABLE_PRODUCTS" p left join "TABLE_MANUFACTURERS" m using(manufacturers_id), "TABLE_PRODUCTS_DESCRIPTION" pd left join "TABLE_SPECIALS" s on p.products_id = s.products_id, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c";.

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {.

   if (!tep_session_is_registered('customer_country_id')) {.

     $customer_country_id = STORE_COUNTRY;.

     $customer_zone_id = STORE_ZONE;.

   }.

   $from_str .= " left join "TABLE_TAX_RATES" tr on p.products_tax_class_id = tr.tax_class_id left join "TABLE_ZONES_TO_GEO_ZONES" gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '"(int)$customer_country_id"') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '"(int)$customer_zone_id"')";.

 }.

 $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '"(int)$languages_id"' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";.

 if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {.

   if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) {.

     $subcategories_array = array();.

     tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);.

     $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '"(int)$HTTP_GET_VARS['categories_id']"'";.

     for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {.

       $where_str .= " or p2c.categories_id = '"(int)$subcategories_array[$i]"'";.

     }.

     $where_str .= ")";.

   } else {.

     $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '"(int)$languages_id"' and p2c.categories_id = '"(int)$HTTP_GET_VARS['categories_id']"'";.

   }.

 }.

 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {.

   $where_str .= " and m.manufacturers_id = '"(int)$HTTP_GET_VARS['manufacturers_id']"'";.

 }.

 if (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

   $where_str .= " and p.products_director = '"(int)$HTTP_GET_VARS['products_director']"'";.

 }.

 if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {.

   $where_str .= " and (";.

   for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {.

     switch ($search_keywords[$i]) {.

       case '(':.

       case ')':.

       case 'and':.

       case 'or':.

         $where_str .= " "$search_keywords[$i]" ";.

         break;.

       default:.

         $keyword = tep_db_prepare_input($search_keywords[$i]);.

         $where_str .= "(pd.products_name like '%"tep_db_input($keyword)"%'";.

         if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%"tep_db_input($keyword)"%'";.

         $where_str .= ')';.

         break;.

     }.

   }.

   $where_str .= " )";.

 }.

 if (tep_not_null($dfrom)) {.

   $where_str .= " and p.products_date_added >= '"tep_date_raw($dfrom)"'";.

 }.

 if (tep_not_null($dto)) {.

   $where_str .= " and p.products_date_added <= '"tep_date_raw($dto)"'";.

 }.

 if (tep_not_null($pfrom)) {.

   if ($currencies->is_set($currency)) {.

     $rate = $currencies->get_value($currency);.

     $pfrom = $pfrom / $rate;.

   }.

 }.

 if (tep_not_null($pto)) {.

   if (isset($rate)) {.

     $pto = $pto / $rate;.

   }.

 }.

 if (DISPLAY_PRICE_WITH_TAX == 'true') {.

   if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= "(double)$pfrom")";.

   if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= "(double)$pto")";.

 } else {.

   if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= "(double)$pfrom")";.

   if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= "(double)$pto")";.

 }.

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {.

   $where_str .= " group by p.products_id, tr.tax_priority";.

 }.

 if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {.

   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {.

     if ($column_list[$i] == 'PRODUCT_LIST_NAME') {.

       $HTTP_GET_VARS['sort'] = $i+1'a';.

       $order_str = ' order by pd.products_name';.

       break;.

     }.

   }.

 } else {.

   $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);.

   $sort_order = substr($HTTP_GET_VARS['sort'], 1);.

   $order_str = ' order by ';.

   switch ($column_list[$sort_col-1]) {.

     case 'PRODUCT_LIST_MODEL':.

       $order_str .= "p.products_model "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

     case 'PRODUCT_LIST_NAME':.

       $order_str .= "pd.products_name "($sort_order == 'd' ? "desc" : "");.

       break;.

     case 'PRODUCT_LIST_MANUFACTURER':.

       $order_str .= "m.manufacturers_name "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

     case 'PRODUCT_LIST_QUANTITY':.

       $order_str .= "p.products_quantity "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

     case 'PRODUCT_LIST_IMAGE':.

       $order_str .= "pd.products_name";.

       break;.

     case 'PRODUCT_LIST_WEIGHT':.

       $order_str .= "p.products_weight "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

     case 'PRODUCT_LIST_PRICE':.

       $order_str .= "final_price "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

       break;.

   }.

 }.

 $listing_sql = $select_str$from_str$where_str$order_str;.

 require(DIR_WS_MODULESFILENAME_PRODUCT_LISTING);.

?>.

       </td>.

     </tr>.

     <tr>.

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>.

     </tr>.

     <tr>.

       <td class="main"><?php echo '<a href="'tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(array('sort', 'page')), 'NONSSL', true, false)'">'tep_image_button('button_back.gif', IMAGE_BUTTON_BACK)'</a>'; ?></td>.

     </tr>.

   </table></td>.

<! body_text_eof //>.

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">.

<! right_navigation //>.

<?php require(DIR_WS_INCLUDES'column_right.php'); ?>.

<! right_navigation_eof //>.

   </table></td>.

 </tr>.

</table>.

<! body_eof //>.

<! footer //>.

<?php require(DIR_WS_INCLUDES'footer.php'); ?>.

<! footer_eof //>.

<br>.

</body>.

</html>.

<?php require(DIR_WS_INCLUDES'application_bottom.php'); ?>..

Comment #10

Was it a text field or int id..

If (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

  $where_str .= " and p.products_director = '"(int)$HTTP_GET_VARS['products_director']"'";.

}.

The above like manufactures will limit the search to products with the selected director..

You cant do both ways.

If (isset($HTTP_GET_VARS['products_director'])) {.

$keywords = $HTTP_GET_VARS['products_director'];.

}.

If it's a text field then maybe you want to do this..

If (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

  $where_str .= " or pd.products_director like '%"tep_db_input($HTTP_GET_VARS['p.products_director'])"%'";.

}.

Otherwise I give up trying to guess...

Comment #11

Ok, thanks for your reply once again!.

It is a TEXT field..

   if (isset($HTTP_GET_VARS['products_director'])) {.

     $products_director = $HTTP_GET_VARS['products_director'];.

   }.

I changed from.

$keyword.

To.

$products_director.

So now all searchfields are actually functioning. Before it was like no searchterm would get through, I just got an error saying I need at least this many letters to be able to search.....

So now the original input fields work as they should, however the director field don't limit the search to products with the selected director, I seem to get ALL products whatever search string I use..

I tried the code combinations below along with the code above. I didn't really understand what you meant with "you can't do both ways". If I remove the code above my input in the driectors field is always ignored..

 if (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

   $where_str .= " and p.products_director = '"(int)$HTTP_GET_VARS['products_director']"'";.

   .

 }.

ALL products.

 if (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

   $where_str .= " and p.products_director = '"(int)$HTTP_GET_VARS['products_director']"'";.

   .

 }.

ALL products.

 if (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

   $where_str .= " or p.products_director like '%"tep_db_input($HTTP_GET_VARS['p.products_director'])"%'";.

   .

 }.

All products.

 if (isset($HTTP_GET_VARS['p.products_director']) && tep_not_null($HTTP_GET_VARS['p.products_director'])) {.

   $where_str .= "(p.products_director like '%"tep_db_input($HTTP_GET_VARS['p.products_director'])"%'";.

   .

 }.

All products.

Hm... I'm clueless.....

Comment #12

Ok one more time..

If (isset($HTTP_GET_VARS['products_director']) && tep_not_null($HTTP_GET_VARS['products_director'])) {.

  $where_str .= " and p.products_director like '%"tep_db_input($HTTP_GET_VARS['products_director'])"%'";.

}.

There should be no p. in here.

$HTTP_GET_VARS['p.products_director']..

Comment #13

It seems to work now!!.

Hopefully adding more searchable fields wont screw things up, but I don't think so. It seems like it all works perfectly this time!.

....

Hm, did a quick test; duplicating the exact code that worked perfect for products_director just replacing "director" with "cast" and it works, finally! Sweet..

Is this the first write up on how to add more search fields ever on this forum?? Well, anyways, thank you very much for your help 'user99999999'!..

Comment #14

I'm develping a store for selling DVD's. I have added many new fields which I would like to be able to search, in advanced_search.php. I have added fields for actors, director, length, audio, video, region and some more to the database that are now being displayed in product_info.php.... Now I want to search the database for a specific director..

I have really searched for and scanned through the forums but couldn't find any really concrete help in achieving this. Most answers seem to be to just use 'search in description' but that's not an option I'm afraid, I must have new searchable input fields.....

I know it can be done, but as usual my php and oscommerce skills aren't really that great so the best I've done so far is a bunch of errors!!.

Has anyone added more input fields in 'advance_search.php' ?

Comment #15


This question was taken from a support group/message board and re-posted here so others can learn from it.