Thread: hideCategories

Page 33 of 49 FirstFirst ... 23313233343543 ... LastLast
Results 321 to 330 of 487
  1. #321
    Join Date
    Feb 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: hideCategories

    I have also now imported the sql with phpadmin still the same result. No change in store admin catagories when you go to edit.

    If anyone has run across this please give me a clue as to what I need to do to make this work?

    Thanks in advance,
    Suzanne

  2. #322
    Join Date
    Feb 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: hideCategories

    I'm going to stop posting, LOL. Every time I finally get to the point where I ask for help I find out what I have done wrong just a little while later.

    It helps If you put the files where the directions tell you too.

    Sorry for posting out of stupidness.

    Suzanne

  3. #323
    Join Date
    Feb 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: hideCategories

    I just installed this and it does work great! However it does overwrite product_listing.php which is also used for the Column Layout Grid mod. I love these both and have tried to winmerge them but it still messes with the Column Layout Grid.

    Can anyone tell me how to fix the issue?

    I just don't know enough to fix something like this. I would love to use both of these contributions but as it stands now i guess I'm going to have to make a choice between them.

    Suzanne

  4. #324
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: hideCategories

    Quote Originally Posted by triple Moon Ranch View Post
    I just installed this and it does work great! However it does overwrite product_listing.php which is also used for the Column Layout Grid mod. I love these both and have tried to winmerge them but it still messes with the Column Layout Grid.

    Can anyone tell me how to fix the issue?

    I just don't know enough to fix something like this. I would love to use both of these contributions but as it stands now i guess I'm going to have to make a choice between them.

    Suzanne
    This thread truly is not the place to troubleshoot what really amounts to something that is NOT an issue with this mod at all, but an issue with HOW to properly merge the files this mod and another mod have in common.. If you are unable to correctly make the changes, my suggestion is to give some thought to paying someone to help you with this file merge and be done with it.. Otherwise you will have to decide between the two mods..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #325
    Join Date
    May 2007
    Posts
    47
    Plugin Contributions
    0

    Default Re: hideCategories

    Hi Im using Hide Categories 2.0 and I use it to hide all the category folders BUT I would still like to allow the normal zencart search option.

    Would it be difficult to modify the code to allow the searching and where would I start :)

    Great contribution by the way...

  6. #326
    Join Date
    Jan 2011
    Posts
    16
    Plugin Contributions
    0

    Default Re: hideCategories

    Hi Guys,

    Hide Categories is just what we need to be able to manage the update of huge numbers of products from multiple vendors and hide new categories while they are being worked on. I see that several sideboxes have been fixed so that hide categories will work with them. I need to try to make it work with the CSS dropdown menu and the CSS flyout menu.

    After looking the files up and down, I have determined that the file in classes called category_ul_generator.php (which is used by both mods) is where the hide categories code should be inserted, but I am having a hard time getting it to work.

    The file appears to run through the list of categories from the database in a while loop. A series of conditionals determines whether it is a upper listing or a list item, then it builds a list with the ul and li tags programmatically inserted.

    I guess I need to rewrite the existing query to the database:

    function zen_categories_ul_generator() {
    global $languages_id, $db, $request_type;
    $this->server = ((ENABLE_SSL == true && $request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER);
    $this->base_href = ((ENABLE_SSL == true && $request_type == 'SSL') ? DIR_WS_HTTPS_CATALOG : DIR_WS_CATALOG);
    $this->data = array();
    $categories_query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd " .
    "where c.categories_id = cd.categories_id and c.categories_status=1 and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
    "order by c.parent_id, c.sort_order, cd.categories_name";
    $categories = $db->Execute($categories_query);

    To indclude the info requested by the hide categories query:

    list($nada, $mycpath)= split('=', $box_categories_array[$i]['path']);

    $mycid = split('_', $mycpath);

    $categories_id = array_pop($mycid);

    $hide_status = $db->Execute("select visibility_status

    FROM " . TABLE_HIDE_CATEGORIES . "

    WHERE categories_id = " . $categories_id . "

    LIMIT 1");

    so it gets all the information for each category at one time.

    Then insert a conditional in this while loop that causes it to skip any hidden category or category whose parent is hidden.

    while (!$categories->EOF) {
    $products_in_category = (SHOW_COUNTS == 'true' ? zen_count_products_in_category($categories->fields['categories_id']) : 0);
    $this->data[$categories->fields['parent_id']][$categories->fields['categories_id']] = array('name' => $categories->fields['categories_name'], 'count' => $products_in_category);
    $categories->MoveNext();
    }

    if ($hide_status->fields['visibility_status'] < 1) {

    I've tried to do this but am not knowledgable enough to get it right. Please help.

    Adowty

  7. #327
    Join Date
    Jan 2011
    Posts
    16
    Plugin Contributions
    0

    Default Re: hideCategories

    Here is what I got so far.
    after some reading about sql query syntax, I tried this:

    $categories_query = "select c.categories_id, cd.categories_name, c.parent_id, visibility_status
    from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_HIDE_CATEGORIES . "
    where c.categories_id = cd.categories_id
    and visibility_status < 1 " .
    " and c.categories_status=1 " .
    " and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
    " order by c.parent_id, c.sort_order, cd.categories_name";

    Seems like the WHERE part of the query should filter out all hidden categories.

    Doesn't work yet.

    Any help?

  8. #328
    Join Date
    Jan 2011
    Posts
    16
    Plugin Contributions
    0

    Default Re: hideCategories

    ...so for anyone else who needs to do this.

    I found the correct syntax in the site map file.

    $categories_query = "select c.categories_id, cd.categories_name, c.parent_id
    from " . TABLE_CATEGORIES . " c LEFT JOIN "
    . TABLE_HIDE_CATEGORIES . " h ON (c.categories_id = h.categories_id), "
    . TABLE_CATEGORIES_DESCRIPTION . " cd
    where (h.visibility_status < 2 OR h.visibility_status IS NULL)
    and c.categories_id = cd.categories_id
    and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and c.categories_status != '0'
    order by c.parent_id, c.sort_order, cd.categories_name";


    Yee-Haw

  9. #329
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: hideCategories

    You should also post this in the support threads for the mod you are modifying as this is code to modify two menu modules to work with hieCategories and as such, it will probably be more useful posted there..

    Quote Originally Posted by adowty View Post
    ...so for anyone else who needs to do this.

    I found the correct syntax in the site map file.

    $categories_query = "select c.categories_id, cd.categories_name, c.parent_id
    from " . TABLE_CATEGORIES . " c LEFT JOIN "
    . TABLE_HIDE_CATEGORIES . " h ON (c.categories_id = h.categories_id), "
    . TABLE_CATEGORIES_DESCRIPTION . " cd
    where (h.visibility_status < 2 OR h.visibility_status IS NULL)
    and c.categories_id = cd.categories_id
    and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and c.categories_status != '0'
    order by c.parent_id, c.sort_order, cd.categories_name";


    Yee-Haw
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  10. #330
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: hideCategories

    So I finally got some time to test this.. works perfectly in my dev store..

    Quote Originally Posted by kamelion0927 View Post
    Alrighty, I think I've got it.

    MAKE A BACKUP BEFORE YOU MAKE THIS CHANGE BECAUSE THIS ISN'T AN OVERRIDE FILE and it worked for me, but I'm not 100% sure it is correct.

    In includes/modules/pages/advanced_search_result/header.php, find
    PHP Code:
    $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_META_TAGS_PRODUCTS_DESCRIPTION " mtpd
                 ON mtpd.products_id= p2c.products_id
                 AND mtpd.language_id = :languagesID"

    and change to
    PHP Code:
    $from_str "FROM (" TABLE_HIDE_CATEGORIES " h, " 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_META_TAGS_PRODUCTS_DESCRIPTION " mtpd
                 ON mtpd.products_id= p2c.products_id
                 AND mtpd.language_id = :languagesID"

    Then find
    PHP Code:
    // Notifier Point
    $zco_notifier->notify('NOTIFY_SEARCH_FROM_STRING');

    $where_str " WHERE (p.products_quantity > 0
                   AND p.products_status = 1
                   AND p.products_id = pd.products_id
                   AND pd.language_id = :languagesID
                   AND p.products_id = p2c.products_id
                   AND p2c.categories_id = c.categories_id "

    and change to
    PHP Code:
    // Notifier Point
    $zco_notifier->notify('NOTIFY_SEARCH_FROM_STRING');

    $where_str " WHERE (p.products_quantity > 0
                   AND p.products_status = 1
                   AND p.products_id = pd.products_id
                   AND pd.language_id = :languagesID
                   AND p.products_id = p2c.products_id
                   and (p.master_categories_id = h.categories_id and h.visibility_status !=2)
                   AND p2c.categories_id = c.categories_id "

    All I did was utilize the code from hideCategories/includes/modules/sideboxes/my_template/whats_new.php and adapted it to fit the search code.

    Hopefully it will continue to work and not cause issues with any of my other mods but I would appreciate feedback from someone who knows code as to whether it is the appropriate way to handle this situation.

    Thanks!
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 
Page 33 of 49 FirstFirst ... 23313233343543 ... LastLast

Similar Threads

  1. how to get hidecategories an dual pricing to work
    By davidweaver88 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 4 Jun 2012, 03:35 PM
  2. anyone using HideCategories in 1.3.9d??
    By redheads in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 8 Jun 2010, 06:54 AM
  3. HideCategories problem...
    By ShadowAngel in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Nov 2009, 10:17 PM
  4. hideCategories Module
    By marcusimages in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 25 Aug 2009, 06:31 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