Page 1 of 2 12 LastLast
Results 1 to 10 of 52

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields

    well somehow i figured it out but get a strange error...

    the search can be expanded to custom tables by adding this to your
    /include/modules/pages/advanced_search_results/header_php.php

    - assuming you have a field called extras_flammability_test
    if (isset($_GET['extras_flammability_test'])) {

    $extras_flammability_test = $_GET['extras_flammability_test'];

    }
    then in the $define_list = array
    i added something like
    'PRODUCT_EXTRAS_FLAMMABILITY_TEST' => PRODUCT_EXTRAS_FLAMMABILITY_TEST,
    in the query i added
    LEFT JOIN " . TABLE_PRODUCTS_EXTRA_STUFF. " pu

    ON pu.products_id= p2c.products_id
    and did some other minor changes to the file. The search performs and gets the products where the criteria are matching, but somehow on every result i get there are 4 buttons to add the product to the shopping cart - i m looking at it for quite a time now but cannot find out what went wrong - has anyone a hint or point my stupid face to it so i can find the problem? thank you -
    the advanced search can be found here
    (the page is under developement right now and there are only test products included but for testing purposes it should be okay)

    thanks for help!
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  2. #2
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields

    okay found the problem - often it just helps to write it down and ask in the forums and then give the answer to it myself
    if anyone is interested in the solution let me know
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Advanced Search - customized product fields

    It is always helpful if you post the solution to any problem, even if you do work it out for yourself, so that others can be helped by your discoveries ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields?

    yeah - that`s what i want to do but ran into antother problem

    i want to select a value "class_of_absorbtion" which can be in three different tables (for each product). This value can be in one, two or three or neither of the tables. I have and sql statement like this:

    WHERE (p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 AND p.products_id = p2c.products_id AND p.products_id = pu.products_id AND p.products_id = pac.products_id AND p.products_id = puc.products_id AND p.products_id = pic.products_id AND p2c.categories_id = c.categories_id AND (pac.class_of_absorbtion OR puc.class_of_absorbtion_second OR pic.class_of_absorbtion_third) ='B'
    so there are three tables of class_of_absorbtion. Im confused about the OR and AND statement - my code doesn`t work so maybe i have again something wrong in my php or even in my logic.
    If anyone could have a quick look at this would be very nice!
    thank you!
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  5. #5
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields?

    no one helping? what a bummer....
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  6. #6
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields?

    Hi!
    I`m really stuck over here so if anyone could help me that would be sooooooooo nice...
    I'm trying to explain my problem again:

    I have 3 Tables called:
    products_acoustics
    products_acoustics_second
    products_acoustics_third

    each table contains a field products_id and a field for the acoustics information which can be values from A to E.
    the three fields for the acoustics information are called
    class_of_absorbtion (for table products_acoustics)
    class_of_absorbtion_second (for table products_acoustics_second)
    class_of_absorbtion_third (for table products_acoustics_third)

    so i think i need to "left join" these tables together so i can get the coresponding product with just one "where" clause, right?

    I tried the following (from clause)
    $from_str = "FROM (" . TABLE_PRODUCTS . " p

    LEFT JOIN " . TABLE_MANUFACTURERS . " m

    USING(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )

    LEFT JOIN " . TABLE_PRODUCTS_EXTRA_STUFF. " pu

    ON pu.products_id= p2c.products_id


    LEFT JOIN " . TABLE_PRODUCTS_ACOUSTICS. " pac
    ON pac.products_id = p2c.products_id
    LEFT JOIN " . TABLE_PRODUCTS_ACOUSTICS_SECOND. " puc
    ON pac.products_id = puc.products_id
    LEFT JOIN " . TABLE_PRODUCTS_ACOUSTICS_THIRD. " pic
    ON pac.products_id = pic.products_id


    LEFT JOIN " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd

    ON mtpd.products_id= p2c.products_id

    AND mtpd.language_id = :languagesID";



    $from_str = $db->bindVars($from_str, ':languagesID', $_SESSION['languages_id'], 'integer');
    and here the where clause
    if (isset($_GET['class_of_absorbtion']) && zen_not_null($_GET['class_of_absorbtion'])) {

    $where_str .= " AND (pac.class_of_absorbtion
    OR puc.class_of_absorbtion_second
    OR pic.class_of_absorbtion_third) = :absoID";
    $where_str = $db->bindVars($where_str, ':absoID', $_GET['class_of_absorbtion'], 'string');


    }
    I know i must have gotten something wrong, because still only the first table "class_of_absorbtion" and the field "class_of_absorbtion" is searched. If anyone could help me a little on this, would be sooo nice. Hope anyone does. Thank you!
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  7. #7
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields?

    well now i solved it - was just a tiny little thing, but if no one helps these things are sometimes hard to find

    here`s the code for the correct where clause

    Code:
     $where_str .= " AND (pac.class_of_absorbtion=:absoID
     OR puc.class_of_absorbtion_second=:absoID
    OR pic.class_of_absorbtion_third=:absoID)";
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  8. #8
    Join Date
    Jul 2009
    Posts
    5
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields?

    Sorry Zvenson,

    you are right. That's the situation in advanced search:

    - if I leave the search field "keywords" blank and i fill only the new search field with an author name (it is supposed to search in my new field "author"), zen cart tell me "You must fill at least one field of research"

    - if i fill "keywords" with a word and the new field with an author name, zencart gives me back only the products that match the first criteria

    So, Zenky seems to ignore my second search field...

  9. #9
    Join Date
    May 2009
    Posts
    63
    Plugin Contributions
    0

    Default Re: Advanced Search - customized product fields?

    Hi Marco!
    Well, my first thought is, that there must be something wrong in this line where you put this:
    && empty($products_author)
    this line should check if the author (or any other field) is empty and if so - you get the error message that nothing has been entered. Well - the reason for this could be, that the "$products_author" variable is empty - try inserting an
    Code:
    echo $products_author;
    above the line where all the "&& emptys" are - then enter a search word in the products author field - do a search and look if the $produts_author is "echoed" (printed) somewhere on your screen. if it is not - then there must be something wrong bevor the actuall search is done...
    Hope this again helps a little!
    www.acousticsdb.com - soundproofing and room acoustics matters | webdesign hamburg

  10. #10
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Advanced Search - customized product fields?

    I'm now following this thread for my own reasons! I have added a new table of product details (e) instead of adding to the product table. All of possible search fields are boolean - either 1 or 0 which is served by checkboxes on the search form.

    So looking at your code suggestion above,
    1) (isset($_GET['dwarf']) && !is_numeric($_GET['dwarf'])) &&
    2) && empty($dwarf)
    3) case 'dwarf':
    $select_column_list .= 'e.dwarf';
    4) if (isset($_GET['dwarf']) && zen_not_null($_GET['dwarf'])) {
    $where_str .= " AND e.dwarf = :dwarf";
    $where_str = $db->bindVars($where_str, ':dwarf', $_GET['dwarf'], 'string');
    }

    this doesn't work - and I know the field isn't a string as in number 4.

    When I say it doesn't work - the search page just refreshed itself and never goes to the results page.

    I'm pretty sure I've got the table added correctly to the select statement and even if I didn't, I'm not getting that far!

    What might be wrong?
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

 

 
Page 1 of 2 12 LastLast

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

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