Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,477

Results 2,021 to 2,040 of 2,268
21 Jan 2012, 12:56 AM
#2021
mbschwerin avatar

mbschwerin

New Zenner

Join Date:
Jan 2012
Posts:
17
Plugin Contributions:
0

Categories Dressing

They are set to be documents only, since they will just be recipes using the products. Recipes showes up in the navigation that appears at the top of the page that I have disabled.

I will check the setting you mentioned and see what that is set to.

21 Jan 2012, 1:05 AM
#2022
mbschwerin avatar

mbschwerin

New Zenner

Join Date:
Jan 2012
Posts:
17
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

Are you certain the Recipes category is enabled in admin? Catalog > Categories/Products > red/green dot. What type of product are the recipes? If they are restricted to Document-Product, they will not appear in the categories menu if you have set Configuration > Layout Settings > Split Categories Box to true.

I set the Configuration > Layout Settings > Split Categories Box to false and it still didn't show up. Once I removed the restrict to General setting, it showed up. I will just have to manually choose the right product type when entering the recipes.

Thanks for the help.:clap:

21 Jan 2012, 12:18 PM
#2023
moley_nation avatar

moley_nation

New Zenner

Join Date:
Dec 2011
Posts:
3
Plugin Contributions:
0

Re: Categories Dressing

Hi, ive been stuck on this for ages now ive managed to put image links on for my product categories but i cant get it to work for the specials, new products and all products links. is there a cpath for these categories?
thanks

and the site is moley.comlu.com

21 Jan 2012, 4:03 PM
#2024
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

Those are not categories, and there is no cPath for them. Instead, they have URLs with main_page=products_all or whatever.

I have added the ability to do image substitution for those links, but will have to check on whether it is in the v2.7.3 standard files, or just a tip posted in this thread.

1 Feb 2012, 1:40 AM
#2025
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: Categories Dressing

Hello,

We have a lot of categories and would it be possible to show just some of it on the main page?
For example, we have 10 main categories and each one has at least 10 subcategories.
Instead of showing all of them, we would like to show all main categories but only the first five of the subcategories like below.

Main Cat 1
Subcat Cat 1
Subcat Cat 2
Subcat Cat 3
Subcat Cat 4
Subcat Cat 5
View All

and so on.
And when a visitor clicks on a subcategory, only the categories in that main category will show or be active on the sidebox.
Sorry if it sounds too confusing, been working on it all day and its quite late now.

Regards

1 Feb 2012, 2:51 AM
#2026
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

Limiting the visible subcats for any one top cat is easy:

#categories li li+li+li+li+li+li {display: none;}

for hiding sixth and following subcats.

But showing the hidden subcats on selection would require a code change, as the classes that indicate this status are on the <a> elements and out of the selector ancestor stream.

There is a standard option in the defines to show all top cats when none are selected, then show only the whole active tree or the active branches when one is selected.

6 Feb 2012, 1:54 AM
#2027
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: Categories Dressing

Hello,

Decided not to show any subcats on the main page but cant get any of the top categories either.
The closest setting to what we need is 5/0/2 but this doesnt show the top categories. I tried the other settings but it doesnt work or maybe my combination is wrong.

I sent you the link to the site to see our current settings.

Thanks

6 Feb 2012, 7:28 AM
#2028
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

Try 2|0|2 for all top cats when none is selected, active tree only when one is selected.

If none of these gets the exact setup you want, a custom case can be written for the define (there are various examples earlier in this thread).

6 Feb 2012, 7:39 AM
#2029
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: Categories Dressing

Hello,

Tried 2/0/2 but it shows top and sub categories on main page. It also shows the top category on the active category which we would like to hide so I think setting 5 is the closest to this.
Just need top categories on main page.

Thanks

6 Feb 2012, 9:43 AM
#2030
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

You have chcategories installed, which will show top and subs on the homepage. You need the base Categories Dressing package for your situation. Case 2 will show top cat as well as subcats when in the active tree, so you would need a slight modification. Add a new case 6 in /includes/functions/extra_functions/categories_dressing_functions.php (function cat_active_level_manage($path) { ) like this: ```php
case 6://active only, without top (all tops when no cat selected)
if($cPath_top != $path_top and $cPath_top != 0) $skip_cat = 1;
if($cPath_top == $path_top and $cat_depth == 0) $skip_cat = 1;
break;

6 Feb 2012, 4:45 PM
#2031
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: Categories Dressing

Hi,

Thanks for taking the time to reply.
Im sorry if I wasnt very clear to what we need but we are after the sub-subcats as well.
Below is the list of what we are trying to achieve.

  • Top Cats on main page only.
  • When a Top Cat is selected, all subcats and sub-subcats are shown but without the Top Cat.

Best Regards

6 Feb 2012, 5:07 PM
#2032
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

What you want is a combination of cases 2,3 and 5:```php
case 2://active only (all tops when no cat selected)
if($cPath_top != $path_top and $cPath_top != 0) $skip_cat = 1;
break;
case 3://full active tree, others per level
if($cPath_top != $path_top) $test_level = 1;
break;

  case 5:// show active, no top, per levels
    if ($cat_depth == 0 or $cPath_top != $path_top) {
      $skip_cat = 1;
    }else{
      $test_level = 1;
    }

Something like this:php
case 6://full active tree, per levels (only all tops when no cat selected)
if($cPath_top != $path_top and $cPath_top != 0) $skip_cat = 1;//skip all non-active tree
if($cPath_top == 0 and $cat_depth != 0) $skip_cat = 1;//skip all subcats when none active
if($cPath_top == $path_top and $cPath_top != 0) $test_level = 1;//show active tree per level settings
break;

This allows your specific layout desire as well as many other variations of it.
6 Feb 2012, 7:17 PM
#2033
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: Categories Dressing

Hello,

That does the trick :)
Thank you so much! Definitely one of the best module available.

Best Regards

8 Feb 2012, 10:06 PM
#2034
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Categories Dressing

I have Category Tab Simple Dropdown Menu installed and I am trying to get the categories sidebox to show the subcategory of the selection made in the tabs across the top.

If I select the top category from the tabs at the top then the sidebox will show the category top level and its subcategories only, but if I choose the subcategory from the dropdown from the tabs at the top then the sidebox does not show any categories, or sub categories.

Zencart 1.3.9 on a test server not a live server so can't show a link. the define I have set up for the categories dressing is: define('CAT_BOX_ACTIVE_LEVEL', '2|0|2');

how can I get it to feed from the subcategory that is being selected on the tabs.

8 Feb 2012, 11:42 PM
#2035
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

The simple dropdown had (still has?) a bug that does not show the top category in the cPath when a subcat is selected. That may well be causing the Categories Dressing malfunction, as it depends on the cPath for many calculations.

12 Feb 2012, 11:38 AM
#2036
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Categories Dressing

gjh42,

Thank you for the reply. I am assuming that I should pop the question to that support thread. Is it not such an easy fix if the bug is still there?

16 Feb 2012, 3:44 PM
#2037
deckandpool avatar

deckandpool

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Categories Dressing

hello

beginner here!!

where does it tell the mod to use catimg3.gif

if that is even a legit question

thanks

colin

17 Feb 2012, 11:27 PM
#2038
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Categories Dressing

MikeyG - I think someone posted a fix for the bug, but not sure if it got officially updated.

deckandpool - The code automatically looks for the existence of an image name matching the category id, and uses it if it finds it. Just delete that demo image or change its name.

21 Feb 2012, 6:33 PM
#2039
deckandpool avatar

deckandpool

New Zenner

Join Date:
Jan 2012
Posts:
10
Plugin Contributions:
0

Re: Categories Dressing

G

thanks

colin

23 Feb 2012, 1:57 PM
#2040
jdahlbom avatar

jdahlbom

New Zenner

Join Date:
Sep 2011
Posts:
26
Plugin Contributions:
0

Re: Categories Dressing

Hi there,

I've got some problem with my category-listing in the sidebox.
I want to hide the top-level category and show the "top-level-sub-category".

Here's my site. As you can see there's only one top-category but there will be more.
http://www.toffeliten.utkast.net/index.php?main_page=index&cPath=52

Here's an example of what I mean:

Headcategory

  • Subcategory
    • Subcategory level 2
    • Subcategory level 2
    • Subcategory level 2
  • Subcategory
    • Subcategory level 2
    • Subcategory level 2

All I want is to only show the Subcategory and not the Headcategory or Subcategory level 2.

Is this possible with this module?
I also use a templatemonster template if that's to any help :P

Here's my tpl_categories code

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] 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>';
  // SPD COMMENTED OUT for ($i=0;$i<sizeof($box_categories_array);$i++) {
  // SPD COMMENTED OUT  switch(true) {
  // SPD ADDITION SINCE COMMENTED OUT ABOVE
  $current_top = 0; //show active cat tree - initialize - above for loop 
  $iteration_top = 0; //show active cat tree - initialize - above for loop 
  for ($i=0;$i<sizeof($box_categories_array);$i++) { 
    switch(true) {
  //SPD END ADDITION
// 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';
      }
  // SPD COMMENTED OUT 
     //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 {
  // SPD END COMMENT OUT
 
  // SPD ADDITION SINCE I COMMENTED OUT SECTION ABOVE
  if ($box_categories_array[$i]['current'] and $box_categories_array[$i]['top'] == 'true') {  //show active cat tree - if current and topcat 
       $current_top = str_replace("cPath=","",$box_categories_array[$i]['path']); //show active cat tree - set = current topcat 
     } //show active cat tree  
     $iteration_top = str_replace("cPath=","",str_replace(strchr($box_categories_array[$i]['path'],"_"),"",$box_categories_array[$i]['path'])); //show active cat tree - set = this iteration's topcat 
     if (($current_top != $iteration_top and isset($cPath) and $cPath != 0) 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) OR (show active cat tree) if not in/under current topcat and there is a selected cat 
     } else {  
  // SPD END ADDITION
 
     // $content .= '<li>';
      $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;
      }
      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 .= '</a><br>';
 
      //$content .= '</li>';
      //$content .= '<br />' . "\n";
    }
 
  }
  //$content .= '</ul>';
  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 .= '<hr id="catBoxDivider" />' . "\n";
    }
    //$content .= '<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>';
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . "\n";
        //$content .= '</li>';
      }
    }
    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>';
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . "\n";
        //$content .= '</li>';
      }
    }
    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>';
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . "\n";
        //$content .= '</li>';
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      //$content .= '<li>';
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
      //$content .= '</li>';
    }
    //$content .= '</ul>';
  }
 
  $content .= '</div>';
?>