Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,641

Results 1,501 to 1,520 of 2,268
5 Oct 2010, 9:00 PM
#1501
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Categories Dressing

I'm sorry I don't understand....

Right now I have the main category of Handbags setup in my admin section. I am using this header because I want it to refelct only the sub categories I have listed under Handbags. I also want the category Handbags to be hidden.

I'm a bit confused at your resopnse as well. So once I set up my categories/sub categories I need to set up the sorting BEFORE setting up the headers? What do I do when I want to add more sub categories? This doesn't make sense to me.

6 Oct 2010, 8:34 PM
#1502
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

autoace - The rules would generally be in a stylesheet, not a PHP file. In short, you can add #indexBody in front of a copy of any style rule, and the different properties in that (like "display: none;") will apply only to "index" pages like category and product listings.

You could also modify the function cat_active_level_manage() in categories_dressing_functions.php.

Can you show me how to modify the function cat_active_level_manage() in categories_dressing_functions.php to show ONLY the ACTIVE categories/sub-cat on the parent and sub-cat pages?

function cat_active_level_manage($path) {
  $skip_cat = 0;
  if (defined('CAT_BOX_ACTIVE_LEVEL')) {
    $test_level = 0;
    $cat_box_active_level = explode('|',constant('CAT_BOX_ACTIVE_LEVEL'));
    $cPath_top = (int)$_GET['cPath'];
    $path_top = (int)$path;
    $cat_depth = substr_count($path,'_');
    //tests for various kinds of skipping - more can be added
    switch ($cat_box_active_level[0]){
      case 0:
        $test_level = 1;
        break;
      case 1://active tree only
        if($cPath_top != $path_top) $skip_cat = 1;
        break;
      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 4://like 3, active branches only
        if($cPath_top == $path_top){
          if ($cat_depth >= 2){//only test sub-subcats+
            $path_ids = explode('_',$path);
            $path_parent = $path_ids[count($path_ids)-2];
            if (!in_array($path_parent,explode('_',$_GET['cPath']))) $skip_cat = 1;//show only subcats w parent in $cPath
          }
        } else {//if not active test for level
          $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;
        }
        break;
    }//switch
    if ($test_level){
      switch ('true'){
        case ($cat_box_active_level[1] > $cat_depth):
          $skip_cat = 1;
          break;
        case ($cat_box_active_level[2] < $cat_depth):
          $skip_cat = 1;
          break;
      }//switch
    }//if
  }//defined
  return $skip_cat;
}

I have these defines in my categories_dressing_defines file:
define('CAT_BOX_ACTIVE_LEVEL', '0|0|1');//shows only top level cats and 1st level sub-cats
--which is what I want but ONLY on the home page.

define('CAT_BOX_ACTIVE_LEVEL', '2|0|1');//active only (all tops when no cat selected)
--on parent and sub-cat pages

7 Oct 2010, 12:31 AM
#1503
srlaird avatar

srlaird

New Zenner

Join Date:
May 2010
Posts:
74
Plugin Contributions:
0

Re: Categories Dressing

I'm surprised I haven't seen this anywhere, but can Categories Dressing allow me to highlight the currently selected category or sub-category with a css background-color?

7 Oct 2010, 2:20 AM
#1504
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

autoace - I'll look at it and get back to you.

srlaird - This is a standard feature of the Zen Cart categories box, and can also be done in Categories Dressing with slightly different selectors.

Stock selectors:
.category-subs-parent, .category-subs-selected

CD selectors:
#categories li a.cat-parent-text, #categories li a.cat-selected-text,
#categories li a.cat-parent, #categories li a.cat-selected, #categories li a.cat-not-selected

7 Oct 2010, 2:51 AM
#1505
srlaird avatar

srlaird

New Zenner

Join Date:
May 2010
Posts:
74
Plugin Contributions:
0

Re: Categories Dressing

These worked for me in stylesheet_boxes.css.

Stock selectors:
.category-subs-parent, .category-subs-selected

I'm not sure why I can't get the others to work using the CD style sheet.

Poetry, once you know the magic words...selectors, that is. Thank you so very much! :bigups:

11 Oct 2010, 11:40 PM
#1506
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

Don't set up groups with headers and then sort them; sort them first, and then put the header at the top of the group.

The header is attached to a particular category, not to a group. Whichever category you want at the top of a group gets the heading.

Hi, can you please review this question again. I'm still confused:

Thank you. That has put the cateogry header on the top.

However I'm still not able to sort the categories. Say for example I'd like to put it in this order:

Louis Vuitton
Chanel
Gucci
Hermes
Fendi

When I number the sort order, Louis Vuitton ends up above the header again.

Also, if I set the cateogry dressing to 80_100 do I adjust this setting if I add more categories? Confused.

Thank you for your prompt reply though! The best support on any add on so far!

Thank you!

12 Oct 2010, 5:10 PM
#1507
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Number the sort order for all of your categories. Then, whichever one ends up on top of your group, give that one the heading (like Louis Vuitton here).

12 Oct 2010, 6:12 PM
#1508
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Categories Dressing

I'm so sorry...but I really don't understand.

I have applied sort order numbers to my categories. However, it doesn't work properly. It'll sort correctly until I get to the last 1-2 sub categories. For example I might number it this way:

Louis Vuitton - 10
Chanel - 20
Gucci - 30
Hermes - 40
Fendi - 50
Prada - 60

The Fendi and Prada (50, 60) sort numbers always end up ABOVE my category header. I'm not sure what's wrong but I've tried to tweak the sort numbers, I've even removed them all together. That works...but I do want to have them sorted. :mellow:

12 Oct 2010, 6:36 PM
#1509
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

That sounds like there is something fundamentally wrong with how the sorting code is working in your site (not related to Categories Dressing). What happens if you just eliminate the heading define altogether? Do Fendi and Prada still show above Louis Vuitton?

12 Oct 2010, 6:47 PM
#1510
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Categories Dressing

Sorting code works okay and doesn't have problems otherwise.

Not sure if I'm using the right heading code for what I'm trying to acheive.

This is how my products are set up:

MASTER HEADING
SUB CATEGORY
SUB CATEGORY
SUB CATEOGRY
PRODUCT

Right now it works but I just have issues with the sorting. All I want is to use the category dressing to replace the MASTER CODE and hide it. Also to show the first sub category.

I'll try to remove the code and double check on the sorting issue as well though...

12 Oct 2010, 9:51 PM
#1511
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

The Cat Dressing code doesn't have the ability to alter the sort/display order, only to control whether an item in the list will display or not. If you have sort order problems, they are caused by something else.

12 Oct 2010, 9:56 PM
#1512
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Categories Dressing

Well thats funny because the sort orders work it just gets funny when the coding is adjusted in the the categories dressing.

Can you at least tell me if I'm using the correct category dressing to acheive what I want to do with the categories? Thank you.

12 Oct 2010, 10:23 PM
#1513
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

I would have to know exactly what the sort order is for each category id at the time I am looking at it on your site. Seeing all of the defines in your categories_dressing_defines.php might help as well. Right now you only have Gift Certificates active, so there is nothing to see.

16 Oct 2010, 11:52 PM
#1514
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Categories Dressing

gjh42 - any word yet on how this (post 1501) might be accomplished?

I'll keep checking back, thanks.

17 Oct 2010, 4:01 PM
#1515
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Not yet - I won't have time this weekend to sit down with it. I think I did a very similar thing for someone else, so may have it somewhere in my test folder.

19 Oct 2010, 6:09 PM
#1516
danatswift avatar

danatswift

New Zenner

Join Date:
Aug 2010
Location:
Norwich, CT
Posts:
26
Plugin Contributions:
0

Re: Categories Dressing

Is it possible to use just one category image for all the categories, with floating text for the individual labels? I'm just trying to keep my site as simple as possible without having to load so many images for each page.

19 Oct 2010, 8:10 PM
#1517
danatswift avatar

danatswift

New Zenner

Join Date:
Aug 2010
Location:
Norwich, CT
Posts:
26
Plugin Contributions:
0

Re: Categories Dressing

I want to clarify my last statement. It's not that I don't want to make the buttons and edit the files, I'm fine with that if needed. It's just that this is an automotive performance shop, and many of my customers are older folks that still have dialup, so I'm more concerned about page loading times, 1 image that's on there and just repeated many times will be much quicker for some of these folks than the 20+ category labels. I would just leave the simple text, but the site also needs to look a little flashy for those folks that care about stuff like that on the site.

19 Oct 2010, 9:29 PM
#1518
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Just make the button image as the background for #categories li {} or #categories li a {}. This will give them all the same button and the text can be stock.

You might need more detailed rules, depending on your circumstances. Post a link to see your site if you need more help.

19 Oct 2010, 9:50 PM
#1519
danatswift avatar

danatswift

New Zenner

Join Date:
Aug 2010
Location:
Norwich, CT
Posts:
26
Plugin Contributions:
0

Re: Categories Dressing

That's on one of the files in the add-on or on one of the system files?

19 Oct 2010, 10:08 PM
#1520
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

It would be in stylesheet_categories_dressing.css.