Results 1 to 10 of 52

Threaded View

  1. #9
    Join Date
    Jan 2013
    Posts
    7
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields

    I've just finished making my advanced search work with all sorts of custom fields and I thought this small piece of info may help someone who is having trouble with the empty keywords on search:

    You dont need to check for an empty anything (there is even a comment stating the check can safely be removed), I started putting all sort of checks for empty against my various fields, but actually if you just remove all the checks and search on nothing it just returns all products... which I think is just fine. Obviously you will still need to apply format checks.

    So there are two places you need to look for these checks:
    There is a client side (js) check in includes/modules/pages/advanced_search/jscript_main.php:

    Code:
    //if ( ((keyword == '') || (keyword.length < 1)) && ((dfrom == '') || (dfrom == '<?php echo DOB_FORMAT_STRING; ?>') || (dfrom.length < 1)) && ((dto == '') || (dto == '<?php echo DOB_FORMAT_STRING; ?>') || (dto.length < 1)) && ((pfrom == '') || (pfrom.length < 1)) && ((pto == '') || (pto.length < 1)) ) {
      //  error_message = error_message + "* <?php// echo ERROR_AT_LEAST_ONE_INPUT; ?>\n";
      //  error_field = document.advanced_search.keyword;
      //  error_found = true;
      //}
    as you can see all commented out.

    Then there is a server side check in includes/modules/pages/advanced_search_result/header_php.php:

    Code:
    /*
    if ( (isset($_GET['keyword']) && (empty($_GET['keyword']) || $_GET['keyword']==HEADER_SEARCH_DEFAULT_TEXT || $_GET['keyword'] == KEYWORD_FORMAT_STRING ) ) &&
    (isset($_GET['dfrom']) && (empty($_GET['dfrom']) || ($_GET['dfrom'] == DOB_FORMAT_STRING))) &&
    (isset($_GET['dto']) && (empty($_GET['dto']) || ($_GET['dto'] == DOB_FORMAT_STRING))) &&
    (isset($_GET['pfrom']) && !is_numeric($_GET['pfrom'])) &&
    (isset($_GET['pto']) && !is_numeric($_GET['pto']))) {
      $error = true;
      $missing_one_input = true;
      $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
    } else {
     * 
     */
    also need to comment out the close to that else statement;

    Another thing that I found was it was quite easy to integrate the dynamic filter plugin with the advance search form - this plugin already allows you to search on any attributes you have. You will need to take out price and category options from here to avoid conflicts with the advanced search.
    Last edited by WebweaverD; 10 Feb 2013 at 08:32 PM.

 

 

Similar Threads

  1. v139h Custom Advanced Search Fields
    By divinelighting in forum General Questions
    Replies: 0
    Last Post: 27 Jul 2012, 08:22 PM
  2. Modify Advanced Search Fields
    By JimRoster in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 9 Oct 2011, 07:41 AM
  3. Modifying the Advanced Search Form Fields?
    By uruharacosplay in forum General Questions
    Replies: 0
    Last Post: 4 Mar 2008, 06:43 PM
  4. Modify Advanced Search Fields
    By icebox500 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 9 Aug 2007, 10:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR