Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Categories NOT show an ACTIVE link

    Hello All,

    Zen v1.3.9h
    Site http://efpsupply.com

    all is working well.

    Just want to seperate out some links for the Categories,

    Thier are some links in the Categories I would like to show
    in another sidebox, so I used the BLANK_SIDE_BOX addon,
    works great and I have the links working fine.

    However now that the SAME links are woking in the new side box
    is there a way to NOT show the links in the Categories box now ?
    as I now have 2 links on the page to the same info.

    Thx,
    Erick

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories NOT show an ACTIVE link

    You would have to do some custom coding in tpl_categories.php to test for those categories and skip them.

    Alternatively, you could install Categories Dressing which will allow you to create the identical look you have with an intermediate heading.

    The tpl_categories edit is pretty simple, so if you will not be modifying your categories any more you could just do that.
    Last edited by gjh42; 20 Nov 2010 at 02:18 AM.

  3. #3
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Categories NOT show an ACTIVE link

    Yes, blocking is good,

    How to test for and remove cats 8,9,10 ?

    Thx so much,
    Erick

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories NOT show an ACTIVE link

    Find this line in tpl_categories.php
    PHP Code:
         if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    and add
    in_array($box_categories_array[$i]['path'], explode(',', '8,9,10')) or
    to get
    PHP Code:
         if (in_array($box_categories_array[$i]['path'], explode(',''8,9,10')) or zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 

  5. #5
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Categories NOT show an ACTIVE link

    Thank youf or that, but it did not seem to work, I can still see the links in the cat sidbox.
    and yes, I edited the file under my template :-)

    Thx,
    Erick

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories NOT show an ACTIVE link

    Perhaps try a simpler but longer way of testing the same thing:

    ($box_categories_array[$i]['path'] == '8' or $box_categories_array[$i]['path'] == '9' or $box_categories_array[$i]['path'] == '10') or
    PHP Code:
         if (($box_categories_array[$i]['path'] == '8' or $box_categories_array[$i]['path'] == '9' or $box_categories_array[$i]['path'] == '10') or
    zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    If it still doesn't work, post the exact content of that part of your tpl_categories.php.

  7. #7
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Categories NOT show an ACTIVE link

    I am sorry, and do appriciate the help, but still a no go,

    I but in both \efpsupply\includes\templates\theme226\sideboxes "MY TEMPLATE"
    AND \efpsupply\includes\templates\template_default\sideboxes "THE DEFAULT TEMPLATE"

    But the page changes in no way.

    I know I am in the right spot under my template as I can remove ALL the code you show and it screws
    the page up, but with both your changes the cats still show in the categories sidebox.

    any thoughts ?

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories NOT show an ACTIVE link

    Either of those will work in stock Zen Cart, so your Template Monster template may have changed something about the way the sidebox works. I can't advise further without seeing your template copy of the file.

  9. #9
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Categories NOT show an ACTIVE link

    I can not see another way of transfering the file so here is ALL the code of the tpl_categories.php


    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_categories.php 4162 2006-08-17 03:55:02Z ajeh $
    */
    $content = "";

    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
    $content .= '<ul>' . "\n";

    $li_class="";

    for ($i=0;$i<sizeof($box_categories_array);$i++) {


    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'):
    if($i == 0)
    {


    $new_style = 'category-top_un';
    $li_class='<li class="category-top_un"><span class="top-span">';
    break;

    }

    else{


    $new_style = 'category-top';
    $li_class='<li class="category-top"><span class="top-span">';
    break;
    }
    case ($box_categories_array[$i]['has_sub_cat']):
    $new_style = 'category-subs';
    $li_class='<li class="category-subs"><span class="top-span">';
    break;
    default:
    $new_style = 'category-products';
    $li_class='<li class="category-products"><span class="top-span">';
    break;




    }


    if (($box_categories_array[$i]['path'] == '8' or $box_categories_array[$i]['path'] == '9' or $box_categories_array[$i]['path'] == '10') or
    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 .= $li_class;



    $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 .= '</span></li>';

    }
    }

    $content .= '</ul>' . "\n";

    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {

    // display a separator between categories and links
    if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
    $content .= '<div id="catBoxDivider"></div>' . "\n";
    }

    $content .= '<div class="box_body_2"><ul>';


    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
    $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
    if ($show_this->RecordCount() > 0) {
    $content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a></li>' . "\n";
    }
    }

    if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
    // display limits
    // $display_limit = zen_get_products_new_timelimit();
    $display_limit = zen_get_new_date_range();

    $show_this = $db->Execute("select p.products_id
    from " . TABLE_PRODUCTS . " p
    where p.products_status = 1 " . $display_limit . " limit 1");
    if ($show_this->RecordCount() > 0) {
    $content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a></li>' . "\n";
    }
    }

    if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') {
    $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1");
    if ($show_this->RecordCount() > 0) {
    $content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a></li>' . "\n";
    }
    }

    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
    $content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a></li>' . "\n";
    }

    $content .= '</ul></div>';

    }
    $content .= '</div>';
    ?>

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories NOT show an ACTIVE link

    I had forgotten that $box_categories_array[$i]['path'] looks like 'cPath=8' and not just '8'. My mods strip that out before using the relevant content.
    Use
    in_array(str_replace('cPath=','',$box_categories_array[$i]['path']), explode(',', '8,9,10')) or
    in the test:
    PHP Code:
    if (in_array(str_replace('cPath=','',$box_categories_array[$i]['path']), explode(',''2,3,10')) or
    zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
    // skip if this is for the document box (==3)
    } else { 

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How to show Multiple Categories Link on product info page?
    By inception in forum General Questions
    Replies: 4
    Last Post: 10 Jan 2015, 02:08 AM
  2. Multiple categories link manager - won't show above 253
    By fakeDecoy in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 19 Oct 2011, 03:11 PM
  3. Categories Box - Show Featured Products Link
    By boy1da in forum General Questions
    Replies: 4
    Last Post: 27 Oct 2010, 04:07 PM
  4. Admin who's online does not show active and inactive carts?
    By dachilla in forum General Questions
    Replies: 2
    Last Post: 28 Dec 2008, 06:53 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