Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / disable subcategory title/ h1

disable subcategory title/ h1

Locked

Views: 6,802

Results 1 to 20 of 37
This thread is locked. New replies are disabled.
2 Apr 2009, 3:02 AM
#1
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

disable subcategory title/ h1

ok, not sure if "title" or "header" is the right word, but basically i want to turn off where it says "collars" in grey on this page (and any other equivalent subcategory page... leashes, harnesses etc)...

is it ok to turn this off in the css? if so, how?

im sure its easy... but i have apparently been making things too complicated lately, so i thought id ask after searching forums/faqs heavily... before just "striking out on my own" lol

http://customk9design.com/catalogzen/index.php?main_page=index&cPath=1

4 Apr 2009, 3:01 AM
#2
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

bumpity bump bump...

27 views, suuuuuurely soooomeone knows how to do this?

:)

4 Apr 2009, 3:15 AM
#3
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

customk1:

ok, not sure if "title" or "header" is the right word, but basically i want to turn off where it says "collars" in grey on this page (and any other equivalent subcategory page... leashes, harnesses etc)...

is it ok to turn this off in the css? if so, how?

im sure its easy... but i have apparently been making things too complicated lately, so i thought id ask after searching forums/faqs heavily... before just "striking out on my own" lol

http://customk9design.com/catalogzen/index.php?main_page=index&cPath=1

Cu,
includes/templates/darkness/css/stylesheet.css

Add this element to the sheet...

#indexCategoriesHeading {display: none;}

4 Apr 2009, 3:25 AM
#4
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

insert evil laugh here*

muhahahahaaaaa....

exxxxcellent... everything is now going according to plan....

(thanks hare... thats what i figured to do, but i seem to be messing up stuff lately. pleased to see that the space was also minimized, not just removed the wording...)

any imput you may have about the remainder of the space there above the 1st subcategory image, and subsequent spacing in between each subcategory row would be helpful as well.

thanks!!! :)

4 Apr 2009, 3:32 AM
#5
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

Cu,
You are most welcome, glad I could assist you..

.categoryListBoxContents {margin-top: -2.5em;}

4 Apr 2009, 4:06 AM
#6
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

hmmm... no such luck on modifying the gap between the subcategory images...?

4 Apr 2009, 4:51 AM
#7
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

haredo:

Cu,
You are most welcome, glad I could assist you..

.categoryListBoxContents {margin-top: -2.5em;}

My mistake,
Change the red font above to this please:

#indexCategories

4 Apr 2009, 4:58 AM
#8
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

that did the trick to raise the whole unit up some, looks much better...

now, how would you define the contents inside the box? to narrow the gap between each sub-category?

thanks.

4 Apr 2009, 5:02 AM
#9
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

Cu,
Find this:

.centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew {
margin:0 0 1em;
}Change this to this please:
.centerBoxContents, .specialsListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew {margin:1em 0;
}

.categoryListBoxContents {
margin:0em 0em 1em 0;
}

4 Apr 2009, 5:07 AM
#10
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

Cu,
After the above change:

Change this please:

#indexCategories {
margin-top: -1.8em;
}

4 Apr 2009, 5:14 AM
#11
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

Cu,
What do you think about this change:

Add this to your_template/ stylesheet.css

.smalltext {margin-top: -1.7em;}

4 Apr 2009, 6:16 AM
#12
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

hare, you are awesome!! thank you so very much.. i actually changed that padding down to .25em b/c i had already left some space in the image itself.. it looks so much better!

i would love your further input if you have the time, actually regarding that shopping cart issue... your fix of the small text negative margin makes it look better, but i dont think "solves" the problem... but to keep things on thread subject, you can switch over to here:
http://www.zen-cart.com/forum/showthread.php?t=124374

to see what ive got going... ultimately, i would like to have it up around the shopping cart image that is part of the header, and have my search bar below that (i will make the header a bit wider black at the bottom if need be...)

AND, if the stars do so decide to shine my way, after i get that cart in place, i would LOVE to figure out a way to have the "free shipping" mod thats on my shopping cart now (lower left corner) that advertises amount needed to add to cart in order to reach $75/free shipping if possible.

anyways, thanks a ton for your help so far, i look forward to working with you more!
-ginny

4 Apr 2009, 1:28 PM
#13
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,183
Plugin Contributions:
0

Re: disable subcategory title/ h1

Cu,

  1. Save a copy of your orginial tpl_header.php
  2. What happens when you try this, and you will half to change our stylesheet.css fix which we changed before.
<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @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_header.php 3392 2006-04-08 15:17:37Z birdbrain $
 */
?>

<?php
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}
?>


<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

<div id="headerWrapper">
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
      } else {
        if (STORE_STATUS == '0') {
?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div class="navMainSearch forward"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->

<!--bof-cartcount display-->
<td width="200">
<table align="right" cellpadding="0" cellspacing="0" width="175">
<tbody><tr><td class="ch">Shopping Cart:</td></tr>
<tr><td height="6"></td></tr>
<tr><td class="tx"><div class="smalltext">
Your shopping cart has:
<?php
if ($_SESSION['cart']->count_contents() == '0') {
echo $_SESSION['cart']->count_contents() . " items";
}
if ($_SESSION['cart']->count_contents() == '1') {
echo $_SESSION['cart']->count_contents() . " item";
}
if ($_SESSION['cart']->count_contents() >= '2') {
echo $_SESSION['cart']->count_contents() . " items";
}
?></a></td></tr>
<!--eof-cartcount display-->


<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
</div>
<!--eof-branding display-->

<!--eof-header logo and navigation display-->

<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->

<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>

If not right, change back to the original...

4 Apr 2009, 1:53 PM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: disable subcategory title/ h1

Just for fun...```php
Your shopping cart has:

<?php if ($_SESSION['cart']->count_contents() == '1') { echo $_SESSION['cart']->count_contents() . " item"; } else { echo $_SESSION['cart']->count_contents() . " items"; } ?>
4 Apr 2009, 2:07 PM
#15
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

ok, tried that...

it made my ezpages bar disappear, (well... no thats just because of all the stuff i had in my header to put it there... so thats no biggie)

but it didnt change the location of the shopping cart info at all..still stacked below my header image...

i tried both versions of the php, from hare and from glenn. (glenn, sorry ive been missing that 2nd "n"! just noticed yesterday.. lol)

dont know why it is so hard to get something to display over that image!!

soooo, just a thought... i can get it to show above the header, and below... but not in.. is it possible that it IS showing in the header when i put it there sometimes, but maybe just "behind" it? so we keep thinking its not working, but it kinda is?? just a thought.

i left the change up, in case you want to view source...

4 Apr 2009, 2:42 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: disable subcategory title/ h1

You already have the "Shopping Cart" title in the header image so you don't need that repeated; all you need is the count displayed in the right place (and the free stuff, too).
All that table code is unnecessary - just pull out the div that does the work, give it an id, and position it absolutely with CSS.

<!--bof-cartcount display-->
<div id="cartCount" class="smalltext">
Your shopping cart has:
<?php
if ($_SESSION['cart']->count_contents() == '1') {
  echo $_SESSION['cart']->count_contents() . " item";
} else {
  echo $_SESSION['cart']->count_contents() . " items";
}
?>
</div>
<!--eof-cartcount display-->

In your stylesheet:```
#cartCount {
position: absolute;
top: 75px;
left: 653px;
height: 3em;
width: 12em;
}

You will need to make a container, like #headerWrapper or #mainWrapper, position: relative; to give this div positioning a stable frame of reference.
4 Apr 2009, 3:11 PM
#17
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

ok, let me make sure i understand...

1st, i want to mention, my "ultimate" goal is to have my "free shipping" mod that works with my sidebox now, to display too... ie "you need $35 more in your cart to qualify for free shipping!" im not sure if that is going to happen inherently with what youre saying, or if i need to "call" it in some way. if you havent used that particular mod (you prob. have...) the only file it changed was the /yourtemplate/sideboxes/tpl_shopping_cart.php.... so i dont have to "call" a different file name...

here is where i put it in the header file, is this correct? or should it actually be in branding or navigation...?

<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
<!--bof-cartcount display-->
<div id="cartCount" class="smalltext">
Your shopping cart has:
<?php
if ($_SESSION['cart']->count_contents() == '1') {
  echo $_SESSION['cart']->count_contents() . " item";
} else {
  echo $_SESSION['cart']->count_contents() . " items";
}
?>
</div>
<!--eof-cartcount display-->
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">

ok, a few questions.
1st off, that WORKED! just need to get it positioned.

  1. "You will need to make a container, like #headerWrapper or #mainWrapper, position: relative; to give this div positioning a stable frame of reference."
    ----- when you say "like", do you mean make a new wrapper called something new, "similar" to #headerWrapper, or you mean "like" as in "either/or"?

  2. how do i make the "free shipping" mod text display below what we just put in, as it does in my sidecart?

  3. if i want to edit the text font/size etc... what would i rename "class=smallfont" to, so i could create a new css reference? (because "class" isnt an id tag like, "div" right? it is the discription right in the code, as opposed to "div" which is referencing something in css? do i understand that correctly?)

4 Apr 2009, 3:14 PM
#18
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

heck, one more question while we're at it, just for learning sake...

what is the difference between this:

if ($_SESSION['cart']->count_contents() == '1') {
  echo $_SESSION['cart']->count_contents() . " item";
} else {
  echo $_SESSION['cart']->count_contents() . " items";

and this:

<?php
if ($_SESSION['cart']->count_contents() == '0') {
echo $_SESSION['cart']->count_contents() . " items";
}
if ($_SESSION['cart']->count_contents() == '1') {
echo $_SESSION['cart']->count_contents() . " item";
}
if ($_SESSION['cart']->count_contents() >= '2') {
echo $_SESSION['cart']->count_contents() . " items";

one has 0,1,2, the other just has 1...? i have seen this variance a lot while ive been working on a solution to putting the shopping cart in the header...?

4 Apr 2009, 3:41 PM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: disable subcategory title/ h1

The shorter version just eliminates unnecessary code. If there is one item, you will want "item", and if there is none or more than one, you will want "items". In this case, only a single test is needed to make the choice of what to display.

You can add the position: relative; to an existing container (wrapper).

You would most likely add the free shipping code just below the cartcount code, in the same div or in another one that you would also position absolutely.

You really don't need the class="smallfont" unless you want that text to be the same as all other .smallfont elements. You can apply whatever text styling you want to #cartCount.

The text takes up a bunch of space - you might want to shorten it to something like

In your cart: 0 items

No need to say "shopping cart" again.

4 Apr 2009, 4:07 PM
#20
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: disable subcategory title/ h1

ok! getting somewhere now!!

im playing around with the positioning now, i added the position:relative to the #headerWrapper...

thanks for explaining the differences in the code...

here is what ive got for the shopping cart now in css: (still positioning though)

#cartCount {
    color: #000000;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: bold;
    text-align: center;
    position: absolute;
    top: 90px;
    left: 730px;
    height: 3em;
    width: 12em;
    }

what i dont understand (im so sorry, you are being so patient!!) is what part of the code to use to get the verbage to show for the free shipping, (and the checkout button if possible) and where to put it... im attaching my template/darkness/sideboxes/tpl_shopping_cart.php file for you here to see, with RED outlining the two parts that are different from the template version.

thanks for the look over.. :)

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cartt 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_shopping_cart.php 4821 2006-10-23 10:54:15Z drbyte $
 * @installation instructions file provided by Judy Gunderson at http://zencart-ecommerce-website-design.com
 */
  $content ="";

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  if ($_SESSION['cart']->count_contents() > 0) {
  $content .= '<div id="cartBoxListWrapper">' . "\n" . '<ul>' . "\n";
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      $content .= '<li>';

      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $content .= '<span class="cartNewItem">';
      } else {
        $content .= '<span class="cartOldItem">';
      }

      $content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER . '</span><a href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">';

      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $content .= '<span class="cartNewItem">';
      } else {
        $content .= '<span class="cartOldItem">';
      }

      $content .= $products[$i]['name'] . '</span></a></li>' . "\n";

      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $_SESSION['new_products_id_in_cart'] = '';
      }
    }
    $content .= '</ul>' . "\n" . '</div>';
  } else {
    $content .= '<div id="cartBoxEmpty">' . BOX_SHOPPING_CART_EMPTY . '</div>';
  }

  if ($_SESSION['cart']->count_contents() > 0) {
    $content .= '<hr />';
    $content .= '<div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
	
   $content .= '<div class="cartSidebox" />';
	
  }

$free_ship_on = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING;

if ($free_ship_on == 'false') {
  $free_limit = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
  if ($_SESSION['cart']->count_contents() > 0) { 
     $_SESSION['cart']->get_products(); 
     $basket_total = $_SESSION['cart']->show_total(); 
     if ($basket_total < $free_limit) { 
        $diff_to_free = ($free_limit - $basket_total); 
        $content .= 'Add '. $currencies->format($diff_to_free) .' to your order to qualify for<br />Free Shipping!'; 
     } else { 
        $content .='Your order qualifies for<br />Free Shipping!'; 
     } 
  } else { 
        $content .= 'Free Shipping for orders of<br />' . $currencies->format($free_limit) . ' or more.'; 
  }
  }
	$content .= '</div>';  

  if (isset($_SESSION['customer_id'])) {
    $gv_query = "select amount
                 from " . TABLE_COUPON_GV_CUSTOMER . "
                 where customer_id = '" . $_SESSION['customer_id'] . "'";
   $gv_result = $db->Execute($gv_query);

    if ($gv_result->RecordCount() && $gv_result->fields['amount'] > 0 ) {
      $content .= '<div id="cartBoxGVButton"><a href="' . zen_href_link(FILENAME_GV_SEND, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_SEND_A_GIFT_CERT , BUTTON_SEND_A_GIFT_CERT_ALT) . '</a></div>';
      $content .= '<div id="cartBoxVoucherBalance">' . VOUCHER_BALANCE . $currencies->format($gv_result->fields['amount']) . '</div>';
    }
  }
  $content .= '<br class="clearBoth" />';
  $content .= '<div class="cartSidebox"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div>';
  $content .= '</div>';
?>