Thread: Search mod.

Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    10
    Plugin Contributions
    0

    Default Search mod.

    Hello,

    I've been working for a while on a search modification. Normally when a user selects ONLY a category or a manufacturer in advanced search there is an error "at least one input missing".

    I wanted to change it so that when the client selects only category/manufacturer the script shows all products from that category/manufacturer. (Or is it the default behaviour of Zen Cart and my install is broken?)

    To do that I created a slight modification in the core files:

    includes/modules/pages/advanced_search_result/header.php

    Code:
      if (isset($_GET['pfrom']) ) {
        $pfrom = $_GET['pfrom'];
      }
    
      if (isset($_GET['pto']) ) {
        $pto = $_GET['pto'];
      }
    changed to: (if price is not defined, take as default 0-999)

    Code:
      if (isset($_GET['pfrom']) ) {
        $pfrom = $_GET['pfrom'];
    	if ( $pfrom == '' ) { $pfrom = '0'; }
      }
    
      if (isset($_GET['pto']) ) {
        $pto = $_GET['pto'];
    	if ( $pto == '' ) { $pto = '999'; }
      }
    And at the end of this file I 'reset' the two variables, so they don't show in the user's browser:

    Code:
    $pfrom='';
    $pto='';
    I also modified the includes/modules/pages/advanced_search/jscript_main.php to skip the price range check. Now, everything works fine, except that I can't browse any other page of results than the first one. When I think of it it's fine becouse I reseted the variables, but on second thought if I define a price range by entering it in the boxes I can browse all pages.

    My question would be: Where can I actually find the part of the code that is responsible for the generation of 'page 2..3..' links?

    Or maybe my logic is wrong in the first place and it's impossible to do it that way?

    Address of the website: http://salonbielizny.eu (you can check out the searches)

    Thanks in advance for any clues!
    Last edited by Vall; 5 Mar 2009 at 03:13 PM. Reason: added more information

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Search mod.

    Quote Originally Posted by Vall View Post
    I've been working for a while on a search modification. Normally when a user selects ONLY a category or a manufacturer in advanced search there is an error "at least one input missing".

    I wanted to change it so that when the client selects only category/manufacturer the script shows all products from that category/manufacturer. (Or is it the default behaviour of Zen Cart and my install is broken?)
    Why not just use the manufacturers or categories sidebox to allow a listing of all items in said grouping? No need to use the search field to display all items in a certain category or manufacturer.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2009
    Posts
    10
    Plugin Contributions
    0

    Default Re: Search mod.

    Hello, thanks for the answer! :) I do have the category sidebox, I was rather thinking of manufacturers specifically (categories being an addition since it works that way also). My customer is unfortunetly a little picky when it comes to design and does not want to have two different boxes with manufacturers. But I guess that's what I'm going to do at the end if I can't come to it. :)

    Any code clues please? :)

  4. #4
    Join Date
    Mar 2009
    Posts
    10
    Plugin Contributions
    0

    Default Re: Search mod.

    Hello,

    resurrecting the thread.. :) Now the only thing I'd like to do is:

    I got a select box with lots of options

    Code:
    <select name="sizes">
    Now I want the result to be added to the keyword field, just as if someone wrote the same in keywords. I tried playing with the code in header_php.php file in advanced_search, but with no luck.

    Any help would be appreciated. :)

 

 

Similar Threads

  1. Search Configuration Keys - Admin mod
    By torvista in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 11 Oct 2010, 12:14 PM
  2. Search Admin Mod
    By limelites in forum General Questions
    Replies: 2
    Last Post: 21 May 2009, 01:04 PM
  3. Orders - Improved Search mod for 1.38?
    By xman888 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 17 Feb 2008, 09:58 AM

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