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

Hybrid View

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

    Default Re: Advanced Search Question (limit to category box)

    Are you trying to get rid of the Advanced Search that you would get if you said to search for:
    abc123

    If so, why would you want to do that?

    If I was searching for Apple but wrote in:
    Appel

    I would get nothing and think you had no Apple ...
    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!

  2. #2
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Advanced Search Question (limit to category box)

    Quote Originally Posted by Ajeh View Post
    Are you trying to get rid of the Advanced Search that you would get if you said to search for:
    abc123

    If so, why would you want to do that?

    If I was searching for Apple but wrote in:
    Appel

    I would get nothing and think you had no Apple ...
    True i hadn't thought of that! what about disabling/removing the limit by category box altogether!?? Or does that just cause more problems!??

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

    Default Re: Advanced Search Question (limit to category box)

    That would be a real problem with the Advanced Search ...

    It would be better to figure out what is really causing the issue on the Advanced Search on the Category dropdown ...

    Is there anything to disable the Hidden Categories just to test it without that?

    NOTE: I would really turn off the SEO/rewrites while trying to debug everything ...
    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
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Advanced Search Question (limit to category box)

    Quote Originally Posted by Ajeh View Post
    That would be a real problem with the Advanced Search ...

    It would be better to figure out what is really causing the issue on the Advanced Search on the Category dropdown ...

    Is there anything to disable the Hidden Categories just to test it without that?

    NOTE: I would really turn off the SEO/rewrites while trying to debug everything ...
    Ok

    Ok

    Not that i know off - i could unhide all the hidden menus but that probably wouldn't make a whole lot of difference! I'll try it!

    Have done!

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

    Default Re: Advanced Search Question (limit to category box)

    Just to amuse me ... can you turn off your templates and overrides for the file:
    /includes/templates/your_template_dir/templates/tpl_advanced_search_default.php

    by renaming it:
    /includes/templates/your_template_dir/templates/tpl_advanced_search_default.php_TURNED_OFF

    and see what happens on the Advanced Search ...
    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!

  6. #6
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Advanced Search Question (limit to category box)

    Quote Originally Posted by Ajeh View Post
    Just to amuse me ... can you turn off your templates and overrides for the file:
    /includes/templates/your_template_dir/templates/tpl_advanced_search_default.php

    by renaming it:
    /includes/templates/your_template_dir/templates/tpl_advanced_search_default.php_TURNED_OFF

    and see what happens on the Advanced Search ...
    I've done that!

    I've already tried that and it doesn't make any difference but maybe you can see something i can't......

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

    Default Re: Advanced Search Question (limit to category box)

    And you are sure that the original file:
    /includes/templates/template_default/templates/tpl_advanced_search_default.php

    is the original file for v1.3.9h without any changes?
    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!

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

    Default Re: Advanced Search Question (limit to category box)

    Quote Originally Posted by DivaVocals View Post
    I hate to resurrect such an old post, but in testing a Zen Cart v1.5.1 update to the hideCategories add-on, I was FINALLY able to replicate the issue reported by the creator of this post.. For whatever reason, this issue ONLY occurs when the hideCategories add-on is installed.. I tried the solution posted a while back (see above) and it does indeed resolve the issue.. What I need to know before I claim victoru and add this to the hideCategories fileset is what will this break??

    Calling out to Ajeh as she was the one trying to help resolve/troubleshoot this before..
    More information.. As was pointed out previously by gazag, if one is using the includes/templates/custom_template/sideboxes/tpl_categories.php file with the code modified for the hideCategories add-on, the categories dropdown on the Advanced Search page will default to the last category on the dropdown list instead of "All Categories". Once I restore to the Zen Cart default for the includes/templates/custom_template/sideboxes/tpl_categories.php file, the dropdown defaults to "All Categories" as it should.. If I use the includes/templates/custom_template/sideboxes/tpl_categories.php file with the code modified for the hideCategories add-on, and then use the code posted by moosesoom, then all is right with the world..

    Here is the relevant categories sidebox code if anyone is interested..

    Code:
    //  Begin hideCategories code
        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");
        if ($hide_status->fields['visibility_status'] < 1) {
    //  End hideCategories code
        switch(true) {
    // to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
    // uncomment the select below and set the cPath=3 to the cPath= your_categories_id
    // many variations of this can be done
    //      case ($box_categories_array[$i]['path'] == 'cPath=3'):
    //        $new_style = 'category-holiday';
    //        break;
          case ($box_categories_array[$i]['top'] == 'true'):
            $new_style = 'category-top';
            break;
          case ($box_categories_array[$i]['has_sub_cat']):
            $new_style = 'category-subs';
            break;
          default:
            $new_style = 'category-products';
          }
         if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            // skip if this is for the document box (==3)
          } else {
          $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
    
          if ($box_categories_array[$i]['current']) {
            if ($box_categories_array[$i]['has_sub_cat']) {
              $content .= '<span class="category-subs-parent">' . $box_categories_array[$i]['name'] . '</span>';
            } else {
              $content .= '<span class="category-subs-selected">' . $box_categories_array[$i]['name'] . '</span>';
            }
          } else {
            $content .= $box_categories_array[$i]['name'];
          }
    
          if ($box_categories_array[$i]['has_sub_cat']) {
            $content .= CATEGORIES_SEPARATOR;
          }
          $content .= '</a>';
    
          if (SHOW_COUNTS == 'true') {
            if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
              $content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
            }
          }
    
          $content .= '<br />' . "\n";
        }
      }
      } //  hideCategories code
    I just need to know if moosesoom's code is okay to use. It appears to fix the issue reported.. I just don't know what other "damage" it might do, and just need some feedback..

    Quote Originally Posted by gazag View Post
    Ajeh,

    By process of elimination i have discovered where the error was for the advanced search issue i am having - it is in the tpl_Categories file in my_template/sideboxes

    Have you got any ideas at what to change????

    I have attached the two documents - the one that says moddedforhiddencategories is the one that works fine with advanced search but the categories aren't hidden in the categories sidebox

    the other one works fine for hidden but not for the advanced search!!

    Your help is much appreciated!
    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.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Advanced Search Question (limit to category box)

    Quote Originally Posted by DivaVocals View Post
    I just need to know if moosesoom's code is okay to use. It appears to fix the issue reported.. I just don't know what other "damage" it might do, and just need some feedback..
    You asked if this code is safe to use, so I'm reviewing it from a coding perspective, not from whether it "works" or is the "best" way to do it. You said it works, so I won't concern myself with the functionality.

    1. But the code *is* using the deprecated split() function, so the code will not work on PHP 5.3.0 or newer.
    Those references to split() should be replaced with explode(). See more detail here: http://www.zen-cart.com/entry.php?2-...use-on-PHP-5-3

    2. If there is no valid result returned from the query (again, only in the part of the code you had highlighted), you're triggering PHP Notices needlessly.
    So, changing this line, by adding the part in bold, would be suggested:
    Code:
        if (!$hide_status->EOF && $hide_status->fields['visibility_status'] < 1) {
    If you've got a lot of categories, then it would be smarter to rewrite your whole "read the hide-categories status from the db for each category one-by-one in real time" into "read all the hide-categories-table data into an array once and just do the lookup on that array" in order to minimize the amount of database queries you're triggering.
    But that's getting into optimization, instead of merely "will it work".
    .

    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.

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

    Default Re: Advanced Search Question (limit to category box)

    Quote Originally Posted by DrByte View Post
    You asked if this code is safe to use, so I'm reviewing it from a coding perspective, not from whether it "works" or is the "best" way to do it. You said it works, so I won't concern myself with the functionality.

    1. But the code *is* using the deprecated split() function, so the code will not work on PHP 5.3.0 or newer.
    Those references to split() should be replaced with explode(). See more detail here: http://www.zen-cart.com/entry.php?2-...use-on-PHP-5-3

    2. If there is no valid result returned from the query (again, only in the part of the code you had highlighted), you're triggering PHP Notices needlessly.
    So, changing this line, by adding the part in bold, would be suggested:
    Code:
        if (!$hide_status->EOF && $hide_status->fields['visibility_status'] < 1) {
    If you've got a lot of categories, then it would be smarter to rewrite your whole "read the hide-categories status from the db for each category one-by-one in real time" into "read all the hide-categories-table data into an array once and just do the lookup on that array" in order to minimize the amount of database queries you're triggering.
    But that's getting into optimization, instead of merely "will it work".
    Thanks DrByte.. I haven't a CLUE how to do the optimization you suggest, but I do understand why it needs to be done..

    Now let me go back to a corner and see if I can wrap my head around HALF of what you've just said.. I'm sure I'll be back with more questions..
    Last edited by DivaVocals; 7 May 2013 at 05:42 PM.
    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 1 of 2 12 LastLast

Similar Threads

  1. Width of "Limit to Manufacturer" under advanced search
    By elena1707 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 May 2011, 11:20 PM
  2. Advanced search Limit the manufacturers list
    By ladyink in forum General Questions
    Replies: 1
    Last Post: 9 Oct 2009, 04:10 PM
  3. Replies: 0
    Last Post: 27 May 2009, 06:59 PM
  4. Questions about "Limit to Manufacturer" in Advanced Search.
    By marshall in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 22 Jun 2007, 05:05 AM
  5. "Limit to Category" in Advanced Search defaults to subcateogry
    By lukemcr in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 11 Mar 2007, 04:26 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