Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Male/Female category sideboxes

Male/Female category sideboxes

Locked

Views: 1,746

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
29 Aug 2009, 11:34 AM
#1
upwardtrend avatar

upwardtrend

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Male/Female category sideboxes

Hi,

I have been browsing these forums for a while now but a more specific question and i'm not sure how to search for it.

The current hierarchy is Category name -> [Male/Female] -> [Male/Female] Product page.

This is fine for the middle colum on the index page, but I want to change is the categories sidebox.

I want to have two sideboxes (I know how to add new sideboxes), one for male and one for female. Each sidebox would list the categories that have products for the particular gender. The links would then go the products page which would list the relevant products.

So the hierarchy would look like this: [Male/Female] Category name -> Products for [Male/Female]

My plan is to create two new sideboxes, but I'm not sure about the specific Zen Cart variables I should be looking for to achieve this.

In each sidebox, I want to:
For each category, check if this category has [male/female] products.
Create the link to that category's [male/female] page.

I would like to know from anyone who has done this on their site, where I should be looking.

Any help would be greatly appreciated.

29 Aug 2009, 3:46 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Male/Female category sideboxes

You can use Categories Dressing to achieve the look of two sideboxes. Arrange the category sort order as you desire, with all male or all female categories first, then give the first male category a heading "Male" and start a cat group. Give the first female category a heading "Female" and start a new cat group. Style those two groups in your stylesheet to have box borders and spacing as desired, and turn off all main categories sidebox borders & heading.

29 Aug 2009, 5:00 PM
#3
dropbop avatar

dropbop

Zen Follower

Join Date:
Apr 2008
Location:
Athlone, Ireland
Posts:
177
Plugin Contributions:
1

Re: Male/Female category sideboxes

I use Category dressing on my new site to seperate Male/Female products. take a look here https://www.stapolinpartyshop.com

The whole thing is done using images so you can mak eit look however you want if your any good with the likes of photoshop and slicing images.

29 Aug 2009, 7:12 PM
#4
upwardtrend avatar

upwardtrend

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Male/Female category sideboxes

Ah ok. Thanks for the link. I have installed it and have found the thread on it. I'll be taking a look at it later.

On first glance it seems I can create a new group (say for female) with CAT_BOX_HEADING_1, but won't I still up up against the same problem in that I'll need to know the variables to determine which links to list under which gender?

29 Aug 2009, 7:59 PM
#5
dropbop avatar

dropbop

Zen Follower

Join Date:
Apr 2008
Location:
Athlone, Ireland
Posts:
177
Plugin Contributions:
1

Re: Male/Female category sideboxes

Not at all.

The way I did it is I put evey category as a top category, no subcats.

I simply used images to create headers to make it look like I had to seperate lots of cats. Which makes all the Top categories under the headers look like sub cats.

It takes a little time to get familiar with how it works,

What you could do is, for womens cats create WCATSNAME and for men create MCATNAME as the category names.

If you need any help with it let just reply in this tread or PM me and I will do my best to help you out. Or at least help to take some of the confussion away. lol

29 Aug 2009, 10:01 PM
#6
upwardtrend avatar

upwardtrend

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Male/Female category sideboxes

But I want to keep the heirarchy of the categories as it fits with the way we are presenting our products. But in addition to that I want a different heirarchy for the sidebox. I thik that may be where my confusion comes into it.

It may help if I showed the site (still in progress):
http://shop.mayamada.com

If you click at the images you'll see the category structure (we don't sell shoes by the way, just haven't switched the images yet) which I want to keep the same:

Category->[Male/Female]->[Male/female] products

But I want a different structure for the categories sidebox i.e. [Male/Female] Category list->[Male/Female] product list for that category.

Is it possible to do this with Categories Dressing as it still seems to me that I'll have to make use of the variables?

I still may be missing something though.

29 Aug 2009, 10:15 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Male/Female category sideboxes

You need to know which categories are for male or female products, and give them sort orders in Catalog > Categories/Products > edit category page > sort order box at bottom left. (Say all "male" cats are sort order 1000-1990 and all "female" cats are 2000-2990.) They will then fall into place in the categories sidebox, and you can use the first one of each set to mark the group.
If you don't want to sort the categories but let them take alphabetical order, give all male cats sort order 1 and female cats sort order 2. They will then form two sets of alphabetically-ordered cats.

29 Aug 2009, 10:27 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Male/Female category sideboxes

So you want the organization of the sidebox navigation to be completely different from the organization of the actual categories. That sounds like a bad idea to start. It will also require some custom coding somewhere.

The categories sidebox will not show individual products without applying a separate (incompatible) mod.

30 Aug 2009, 1:43 PM
#9
upwardtrend avatar

upwardtrend

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Male/Female category sideboxes

I'll try using the sort order method. Every top level categorey has a male and female subcategory so that will allow me to seperate between the two.

You could be right thought and maybe it more trouble than it's worth, but I'll give it a go and find out. Ithink I'll have to replicate and extend category_row.php to only display subcategories with sort order 0 (male) and female (1).

I found some variable documentation here by the way might be useful for someone viewing this:

http://phpxref.com/xref/zencart/_variables/index.html

5 Sep 2009, 10:35 PM
#10
upwardtrend avatar

upwardtrend

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Male/Female category sideboxes

I have managed to get back to working out this problem and have come up with a solution but still need some advice.

I have created two ezpages for male and female categories and have followed this thread to allow them to support php:

http://www.zen-cart.com/forum/showthread.php?t=37252

I have given all male categories a sort order of 0 and all female categories a sort order of 1.

I am using sql to get the male and female categories for each page and am using the categories_row.php page as a template to generate the HTML to display. My code looks like this:

$sql = "SELECT * FROM zen_categories WHERE parent_id != 0 AND sort_order=1 ORDER BY parent_id ASC;";

$categories_list = $db->Execute($sql); 

if ($categories_list->RecordCount() > 0) { //if categories are returned from the SQL
	while (!$categories_list->EOF) {
	
		// Female categories have a sort order of 0	
		
		   // if (!$categories_list->fields['categories_image']) !$categories_list->fields['categories_image'] = 'pixel_trans.gif';
		    $cPath_new = zen_get_path($categories_list->fields['categories_id']);
		
		    // strip out 0_ from top level cats
		    $cPath_new = str_replace('=0_', '=', $cPath_new);
	
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
                                           'text' => '
										   
        <table style="width:1px; margin:auto;" align="center";>
        	<tr>
            	<td>
<div class="img_box">
   
										   <a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES .zen_get_categories_image($categories->fields['parent_id']), $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>
   
    </div>
	<br class="clearBoth" />
	

										   <a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories->fields['categories_name'] . '</a><br /><br />                	
                </td>
            </tr>
        </table>
		<br />
');

	    $col ++;
	    if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
	      $col = 0;
	      $row ++;
	    }
		$categories_list->MoveNext();
	}
}

I have the $list_box_contents array, but am not sure how to use it. How do I actually output the HTMl for the categories?

8 Sep 2009, 4:52 AM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Male/Female category sideboxes

You have been talking about a number of different display areas and organizations: the categories sidebox, the category index page and possibly the product listing.

Which do you really want to use? You say you want the existing category organization (topic cat > male/female subcats) to stay as is. That means the category index stays the same.

You say you want the categories sidebox to be organized differently. That could be done by adding a new loop around the main loop to cycle through the categories twice, once selecting and outputting male subcat names and again selecting and outputting female subcat names to display in the sidebox. A question you may not have considered: how are all of these "Male" subcats going to be identified as to topic? If the subcat name is "Male" in each case, you need to do something to avoid confusion. Replacing the subcat names (using Categories Dressing features) with images unique to each subcat having relevant text in the image might work. Renaming the "Male" subcats to "Male Shirts" etc. might also work.

Your latest post talks about reorganizing the category index page. Are you not going to display the categories as the original organization shows?

9 Sep 2009, 9:49 PM
#12
upwardtrend avatar

upwardtrend

New Zenner

Join Date:
Aug 2009
Posts:
9
Plugin Contributions:
0

Re: Male/Female category sideboxes

Sorry for the confusing posts, I was trying to get my head around the concept and was trying different ideas along the way.

I have figured out what I wanted now. What I've done is use ezpages (with php enabled) to create male and female links in the top horizontal menu, each page just displays male or female products.

I haven't changed the category organisation from my first post, just added another method of presentation.