Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2011
    Posts
    6
    Plugin Contributions
    0

    help question where is the SQL that controls what the categories side box outputs?

    Hi,

    I am trying to modify the sql that is used to general the links in the tpl_categories.php files but I can't seem to find it. I think that file uses $box_categories_array to generate the categories.

    Where is the file that I would find the sql for the categories?

    or any pointers?

    thanks,

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: where is the SQL that controls what the categories side box outputs?

    Expand on what you are attempting to accomplish
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Mar 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: where is the SQL that controls what the categories side box outputs?

    Hi,

    http://garagefive.net/z2/

    The zen cart has a bit of custom work done by another developer.

    So basically, there is a vehicle search that will search out all products for that vehicle only and also, customize the categories so that when you click on "intakes", it will only show intakes related to the vehicle.

    So what I am trying to do is to make it so that the categories show the items related to the vehicle selected and also show products that are tagged "universal". The developer made a module in the admin to assign keywords to the products.

    So I was thinking of finding out where the sql is used to generate the categories so that I can modify the sql and have it display the universal products too.

    I've managed to modify the sql for the vehicle selector so that once you choose a vehicle, it will show related items and universal items too but the categories are not affected.

    Thanks,

    Quote Originally Posted by kobra View Post
    Expand on what you are attempting to accomplish
    Last edited by edwinx; 20 Mar 2011 at 01:36 AM.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: where is the SQL that controls what the categories side box outputs?

    You might modify this or write another that takes over once your vehicle search has bee excecuted

    /includes/classes/category_tree.php
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Mar 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: where is the SQL that controls what the categories side box outputs?

    ok, so $box_categories_array is created from the category_tree class?

    actually, honestly, I am not sure how those categories are generated or how the variables in the sql are populated.

    Code:
    $categories_query = "select ptc.category_id as categories_id, cd.categories_name, c.parent_id, c.categories_image
                                 from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " ptc
                                 where c.parent_id = " . (int)$value . "
                                 and ptc.category_id = cd.categories_id
                                 and ptc.product_type_id = " . $master_type . "
                                 and c.categories_id = ptc.category_id
                                 and cd.language_id=" . (int)$_SESSION['languages_id'] ."
                                 and c.categories_status= 1
                                 order by sort_order, cd.categories_name";
    For example, how is TABLE_CATEGORIES variable populated? does zencart know that is a variable and needs to be replaced by an actual value?

    sorry for asking this. or is there a document that would explain this to me?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: where is the SQL that controls what the categories side box outputs?

    Check that file for "categories_array" starting about line 157
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Mar 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: where is the SQL that controls what the categories side box outputs?

    awesome, thanks.

    I see 2 queries in that file, I suppose I should be modifying the 2nd query. Since the 1st one is only when "$product_type == 'all'", right?

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: where is the SQL that controls what the categories side box outputs?

    If you change the query code then you will break the normal display

    I think you need to keep it as is and provide another query that builds another array that is invoked when your customers perform your "vehicle search"

    As I stated initially this might be best in a new file that is called after a search
    Zen-Venom Get Bitten

  9. #9
    Join Date
    Mar 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: where is the SQL that controls what the categories side box outputs?

    Thanks Kobra, I will give it a shot, this will destroy my weekend....

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: where is the SQL that controls what the categories side box outputs?

    Thanks Kobra, I will give it a shot, this will destroy my weekend....
    What else did you have to do!!

    Did ya think that an online business was set and forget?
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. Lost with finding the file that outputs the PRICE on the catagory list
    By 00falcon in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 17 Sep 2009, 06:09 AM
  2. Replies: 4
    Last Post: 31 Aug 2009, 07:59 PM
  3. Where is the page that controls country drop down
    By multichild in forum Templates, Stylesheets, Page Layout
    Replies: 21
    Last Post: 17 Oct 2007, 11:07 AM
  4. Which one is the class or id that controls the categories listing on top of page
    By qm360 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Jul 2007, 02:35 AM
  5. Replies: 2
    Last Post: 6 Feb 2007, 08:51 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