Results 1 to 4 of 4
  1. #1
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    help question Can't find a way to search by Model in Advanced Search - could somebody help please?

    Hi,

    I have spent most of the day trying to find a solution and experimenting but with no luck

    I wonder if a kind soul could advise me. I'm nearly there but stuck.

    The idea is to add an extra search field in the "Advanced Search" form. The field is the product's model, entered in the appropriate box when a product is listed. I'm using v1.3.9h and have so far changed the advanced_search.php file to include an entry for Model (I copied all the entries for Manufacturers and renamed them accordingly). The lines in red below show my added entries in the file.

    Code:
      define('TEXT_SEARCH_IN_DESCRIPTION', 'Search in product descriptions');
      define('ENTRY_CATEGORIES', 'Search by category');
      define('ENTRY_INCLUDE_SUBCATEGORIES', 'Include subcategories');
      define('ENTRY_MANUFACTURERS', 'Search by manufacturer');
      define('ENTRY_MODELS', 'Search by model');
      define('ENTRY_PRICE_RANGE', 'Search by price range');
      define('ENTRY_PRICE_FROM', 'Price from:');
      define('ENTRY_PRICE_TO', 'Price to:');
      define('ENTRY_DATE_RANGE', 'Search by date added');
      define('ENTRY_DATE_FROM', 'Date from:');
      define('ENTRY_DATE_TO', 'Date to:');
    
      define('TEXT_SEARCH_HELP_LINK', 'Need help for a better search?');
    
      define('TEXT_ALL_CATEGORIES', 'All categories');
      define('TEXT_ALL_MANUFACTURERS', 'All manufacturers');
      define('TEXT_ALL_MODELS', 'All models');
    
      define('TABLE_HEADING_IMAGE', '');
      define('TABLE_HEADING_PRODUCTS', 'Product name');
      define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
      define('TABLE_HEADING_MODEL', 'Model');
      define('TABLE_HEADING_QUANTITY', 'Quantity');
      define('TABLE_HEADING_PRICE', 'Price');
      define('TABLE_HEADING_WEIGHT', 'Weight');
      define('TABLE_HEADING_BUY_NOW', 'Buy now');
    Next, I added the lines in red below the manufacturer list lines in the tpl_advanced_search_default.php

    Code:
    <fieldset class="manufacturerList">
        <legend><?php echo ENTRY_MANUFACTURERS; ?></legend>
        <?php echo zen_draw_pull_down_menu('manufacturers_id', zen_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)), PRODUCTS_MANUFACTURERS_STATUS), $sData['manufacturers_id']); ?>
    <br class="clearBoth" />
    </fieldset>
    <br class="clearBoth" />
    
    <fieldset class="modelList">
        <legend><?php echo ENTRY_MODELS; ?></legend>
        <?php echo zen_draw_pull_down_menu('manufacturers_id', zen_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MODELS)), PRODUCTS_MANUFACTURERS_STATUS), $sData['manufacturers_id']); ?>
    <br class="clearBoth" />
    </fieldset>
    <br class="clearBoth" />
    Is there a way to replace the big bold parameters in the above code with the corresponding ones that will allow the "Search by model" to operate?

    I wouldn't want to use add ons or extra side boxes for this facility. I also know that it's simple for the developers to provide an answer, which I couldn't find using the Developers Tool Kit or searching in the forum, the FAQs and the Wiki.

    Please note that the above changes were made to my local installation and are not reflected in the live site.

    Thanks in advance for any assistance and kind regards.

  2. #2
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Can't find a way to search by Model in Advanced Search - could somebody help plea

    Any help please?

    I believe that this is something easy for the ZC developers since "products_model" is a field of the "products" table in the database, or am I wrong because it doesn't have a unique id like the manufactures?

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Can't find a way to search by Model in Advanced Search - could somebody help plea

    This is not just a matter of swapping a constant or variable name; zen_get_manufacturers() is a function that does some lookup and calculating to yield presumably an array of names. You would need to build a new function that did the appropriate work to give the model array.

  4. #4
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Can't find a way to search by Model in Advanced Search - could somebody help plea

    Thank you Glenn, I thought it was something easy (swapping a constant or variable name as you said).

    Building a function is beyond my abilities and, at the end of the day, it's not really that important to me, so I'll forget about it.

    Again, thanks for replying and have a nice day.

 

 

Similar Threads

  1. Remove 'Search Help [?]' from advanced search
    By boy1da in forum General Questions
    Replies: 0
    Last Post: 8 Nov 2010, 09:53 PM
  2. Replies: 5
    Last Post: 20 Apr 2010, 12:54 PM
  3. Header Banner help needed, can't find in search...
    By Zook25 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 20 Aug 2009, 06:52 PM
  4. Please help with Advanced Search box
    By hardwiredtemplates in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 16 Feb 2009, 03:46 AM
  5. Advanced search, please help?
    By dimar in forum General Questions
    Replies: 4
    Last Post: 30 Jan 2009, 02:59 PM

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