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

disable subcategory title/ h1

Locked

Views: 6,802

Results 21 to 37 of 37
This thread is locked. New replies are disabled.
4 Apr 2009, 4:37 PM
#21
gjh42 avatar

gjh42

Black Belt

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

disable subcategory title/ h1

It looks like you would put both of those red sections into your tpl_header.php, below the cartcount div.
The first one has everything needed to calculate and display the free shipping, and the second one has the checkout link.
Make a single div to contain both of them, and give it an id like cartHeader, and position that in your stylesheet the same way as #cartCount.

4 Apr 2009, 4:49 PM
#22
customk1 avatar

customk1

Zen Follower

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

Re: disable subcategory title/ h1

moving in the right direction...

at least it didnt make my whole page disappear like normal when i try to add something... lol

if you look at site, you will see it just dumped the text of the code into the page, instead of actually processing the functions. i do not know php well enough to know what to change, but if i had to guess it would be, add a <?php to the top and a ?> to the bottom?????? :unsure:

your take?
https://www.customk9design.com/catalogzen

4 Apr 2009, 5:17 PM
#23
gjh42 avatar

gjh42

Black Belt

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

Re: disable subcategory title/ h1

Yep, you're right, the PHP code needs its tags for both sections.

There is also a little cleanup needed where the code came out of the longer file. After the first line, there is a } that is no longer useful.
Instead of

$content .=

you will want

echo

to output the content immediately instead of accumulating it.

Alternatively, you could leave the $content .= as is, and add a new line at the end:

<?php echo $content; ?>
4 Apr 2009, 5:43 PM
#24
customk1 avatar

customk1

Zen Follower

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

Re: disable subcategory title/ h1

so i need to tag each statement with <?php ?>
or just one at the beginning and one at the end?

im trying this now: (which made my page disappear! argh. i just cant learn this stuff fast enough, though ive absorbed so much in the last week and a half!)

<?php echo '<div class="cartinfoheader" />'; ?>

<?php $free_ship_on = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING;?>

<?phpif ($free_ship_on == 'false') { ?>
 <?php $free_limit = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER; ?>
  <?php if ($_SESSION['cart']->count_contents() > 0) { ?>
     <?php $_SESSION['cart']->get_products(); ?>
     <?php $basket_total = $_SESSION['cart']->show_total(); ?>
   <?php  if ($basket_total < $free_limit) { ?>
   <?php  $diff_to_free = ($free_limit - $basket_total); ?>
      <?php  $content .= 'Add '. currencies->format($diff_to_free) .' to your order to qualify for<br />Free Shipping!'; ?>
   <?php  } else { 
        $content .='Your order qualifies for<br />Free Shipping!'; 
     } ?>
 <?php } else { 
        $content .= 'Free Shipping for orders of<br />' . $currencies->format($free_limit) . ' or more.'; 
  }?>
  }
	<?php $content .= '</div>'; ?>
<?php $content .= '<div class="cartSidebox"> ?>
<?php <a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div>';?>
5 Apr 2009, 12:07 AM
#25
haredo avatar

haredo

Totally Zenned

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

Re: disable subcategory title/ h1

Gjh42 and Cu,
What was the big fix for this neat little task in the header for the shopping cart add on

5 Apr 2009, 12:15 AM
#26
customk1 avatar

customk1

Zen Follower

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

Re: disable subcategory title/ h1

ok, i have tried adding the <?php and ?> to several spots... what i THINK are the logical places, but it really is just hit and miss for me, due to my lack of knowledge of php... (i cant cram the info in any faster!!!)

when you get a chance to look at this again, let me know.

here is my header file as it currently stands:

<?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 4813 2006-10-23 02:13:53Z drbyte $
 */
?>

<?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-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>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
         <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>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
<!--bof-cartcount display-->
<div id="cartCount">
In My Cart:
<?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">
    <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>
<br class="clearBoth" />
</div>
<!--eof-navigation 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-->
<div id="topbar">
<ul id="topMenuStyle">
<li><a id="item1" href='http://customk9design.com/catalogzen/index.php?main_page=page&id=2'><span class="alt">About Us</span></a></li>
<li><a id="item2" href='http://customk9design.com/catalogzen/index.php?main_page=page&id=3'><span class="alt">Lifetime Guarantee</span></a></li>
<li><a id="item3" href='http://customk9design.com/catalogzen/index.php?main_page=page&id=5'><span class="alt">Eco Friendly</span></a></li>
<li><a id="item4" href='http://customk9design.com/catalogzen/index.php?main_page=contact_us'><span class="alt">Contact Us</span></a></li>
<li><a id="item7" href='http://customk9design.com/catalogzen/index.php?main_page=page&id=9'><span class="alt">Paw Pages</span></a></li>
<li><a id="item5" href='http://customk9design.com/catalogzen/index.php?main_page=advanced_search&search_in_description=1&keyword=Enter%20search%20keywords%20here'><span class="alt">Search</span></a></li>
<li><a id="item6" href='http://customk9design.com/catalogzen/index.php?main_page=shopping_cart'><span class="alt">Shopping Cart</span></a></li>
</ul>
</div>
<?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 } ?>

and here is the complete "tpl_shopping_cart" i would like to see under the existing cart information in the header (with the differences from the template marked in red):

<?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>';
?>

What i would like to have is this (on the right side of the header, over the shopping cart portion of the header image)

In My Cart: xx Items
Total: $xx.xx
Add $xx.xx more to your
cart to qualify for
FREE SHIPPING!
[GO TO CHECKOUT]

5 Apr 2009, 7:06 AM
#27
gjh42 avatar

gjh42

Black Belt

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

Re: disable subcategory title/ h1

<!--eof-branding display-->

<!--bof-cart head info display-->
<div id="cartHead">
<!--bof-cartcount display-->
<div id="cartCount">
In My Cart:
<?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 cartfreeship display-->
<div id="cartFreeShip" />
<?php 
$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); 
        echo 'Add '. $currencies->format($diff_to_free) .' to your order to qualify for<br />Free Shipping!'; 
     } else { 
        echo 'Your order qualifies for<br />Free Shipping!'; 
     } 
  } else { 
        echo 'Free Shipping for orders of<br />' . $currencies->format($free_limit) . ' or more.'; 
  }
  } ?>
</div>
<!--eof cartfreeship display-->

<?php echo '<div id="cartCheckout"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div>'; ?>
</div>
<!--eof-cart head info display-->

<!--bof-navigation display-->
```Change the #cartCount in your stylesheet to #cartHead .
5 Apr 2009, 2:47 PM
#28
customk1 avatar

customk1

Zen Follower

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

Re: disable subcategory title/ h1

im so happy i could cry....

:clap::clap::clap:

wow. thank you so much! this is exactly what i wanted... (i told santa i wanted a pony for christmas, but i REALLY wanted this!!)

ok, just to finalize, i have 3 different divs now i can control:

  1. carthead
  2. cartcount
  3. cartfreeship

if i want to move the whole thing around, or apply css to the whole thing, i use carthead, and if i want to change colors/font/size etc for anything individually, i can separately use cartcount and cartfreeship, correct?

i really like how you separated it all out.

glen, seriously, thank you very very much.

6 Apr 2009, 2:06 PM
#29
haredo avatar

haredo

Totally Zenned

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

Re: disable subcategory title/ h1

Cu,
I have noticed this on the Shopping Cart Page

You may want to add some instructions for using the shopping cart here. (defined in includes/languages/english/shopping_cart.php)

Boy, Thanks to Gjh42, What a nice looking header...

6 Apr 2009, 4:39 PM
#30
customk1 avatar

customk1

Zen Follower

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

Re: disable subcategory title/ h1

it is great! i am very happy with it.

thanks for reminding me about the "shopping cart instructions" just havent gotten to fixing that page yet.

also, i forgot i didnt put my search bar back in yet, so i think im going to take that fake "home" button back out, and just turn on that top nav bar that has home/login/search...

thanks again to gj for an awesome job! i know that this will help other folks too...

6 Apr 2009, 6:29 PM
#31
gjh42 avatar

gjh42

Black Belt

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

Re: disable subcategory title/ h1

I'm working on packaging a mod for this... of course the code gets about three times as long when you properly separate the output text into a language file, and then there's the readme and the GPL license text... :)

6 Apr 2009, 6:32 PM
#32
customk1 avatar

customk1

Zen Follower

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

Re: disable subcategory title/ h1

heyyyy... it was JUST a suggestion... no cursing me while muttering under your breath... :)

(thanks again... )

12 Apr 2009, 10:13 PM
#33
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: disable subcategory title/ h1

WOW, I have been toying around with the cart in the header for a while and now found this thread. Awesome stuff, have to try it out. Thank you. :hug:

12 Apr 2009, 10:19 PM
#34
haredo avatar

haredo

Totally Zenned

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

Re: disable subcategory title/ h1

@mydanilo

Pays to read the subscription threads again when there is a reply. :)

Thanks to Gjh42

5 Dec 2009, 11:40 PM
#35
rainyplace avatar

rainyplace

New Zenner

Join Date:
Nov 2009
Location:
QLD, Australia
Posts:
42
Plugin Contributions:
0

Re: disable subcategory title/ h1

haredo:

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

Add this element to the sheet...

#indexCategoriesHeading {display: none;}

i added this to my includes/templates/cherry_zen/css/stylesheet.css and it didn't work.

I am wanting to remove the subcategory titles and have pics only on the subcategory menu page (hope i wrote that right)

ie; a picture with "car stickers" instead of a picture plus the words underneath it

Cheers
Grant.

5 Dec 2009, 11:56 PM
#36
rainyplace avatar

rainyplace

New Zenner

Join Date:
Nov 2009
Location:
QLD, Australia
Posts:
42
Plugin Contributions:
0

Re: disable subcategory title/ h1

Rainyplace:

i added this to my includes/templates/cherry_zen/css/stylesheet.css and it didn't work.

I am wanting to remove the subcategory titles and have pics only on the subcategory menu page (hope i wrote that right)

ie; a picture with "car stickers" instead of a picture plus the words underneath it

Cheers
Grant.

this worked like a charm :clap:
http://www.zen-cart.com/forum/showthread.php?t=107377&highlight=remove+subcategories+titles

14 Dec 2009, 7:34 AM
#37
bparker avatar

bparker

Zen Follower

Join Date:
Oct 2008
Location:
Rochester, NY
Posts:
232
Plugin Contributions:
0

Re: disable subcategory title/ h1

Hmm... thanks for the advice.