Forums / Templates, Stylesheets, Page Layout / Changing the links in the header

Changing the links in the header

Locked

Views: 690

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 Sep 2008, 10:02 PM
#1
beama avatar

beama

New Zenner

Join Date:
Jun 2008
Location:
Ontario, Canada
Posts:
54
Plugin Contributions:
0

Changing the links in the header

Hello,

Im trying to figure out how to change the order of the links in the header, plus add a link that shows the number of items and amount a customer has ordered so far.
I know that i have to change the file tpl_header. My problem is that i don't have the deepest understanding of PHP.
-Right now when the customer IS logged and has something in their cart the header shows the following links:
Checkout/Shopping Cart/My Account/Logout/1 Item - $3.99
and when the cart is empty...
My Account/Logout/0 Items - $0.00

-When they are NOT logged in and they have something in the cart it shows
Checkout/Shopping Cart/Log In/1 Item - $3.99
and when the cart is empty...
Log In/0 Items - $0.00

Ultimately I want the order to be...

Log In(..or Logout)/My Account (when logged in)/2 Items - $3.99( as a link to the shopping cart)/Checkout

Currently I have the following code can someone please help me!

    <ul class="back">
 <!--  <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> -->
 <li>
 <?php if ($_SESSION['cart']->count_contents() > 1) {
$products = $_SESSION['cart']->get_products();
echo '' . $_SESSION['cart']->count_contents().'<a href="/cart/index.php?main_page=shopping_cart">Items - ';
echo $currencies->format($_SESSION['cart']->show_total());
}

if ($_SESSION['cart']->count_contents() == 1) {
$products = $_SESSION['cart']->get_products();
echo '' . $_SESSION['cart']->count_contents().'<a href="/cart/index.php?main_page=shopping_cart">Item - ';
echo $currencies->format($_SESSION['cart']->show_total());
}

if ($_SESSION['cart']->count_contents() == 0) {
$products = $_SESSION['cart']->get_products();
echo '<a href="/cart/index.php?main_page=shopping_cart"> Items $0.00';
}
?>
</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>
12 Sep 2008, 10:05 PM
#2
beama avatar

beama

New Zenner

Join Date:
Jun 2008
Location:
Ontario, Canada
Posts:
54
Plugin Contributions:
0

Re: Changing the links in the header

oops...here is the code...sorry i'm not sure how to place it in the scroll box

<ul class="back">
<!-- <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> --> <li> <?php if ($_SESSION['cart']->count_contents() > 1) { $products = $_SESSION['cart']->get_products(); echo '' . $_SESSION['cart']->count_contents().'<a href="/cart/index.php?main_page=shopping_cart">Items - '; echo $currencies->format($_SESSION['cart']->show_total()); }

if ($_SESSION['cart']->count_contents() == 1) {
$products = $_SESSION['cart']->get_products();
echo '' . $_SESSION['cart']->count_contents().'<a href="/cart/index.php?main_page=shopping_cart">Item - ';
echo $currencies->format($_SESSION['cart']->show_total());
}

if ($_SESSION['cart']->count_contents() == 0) {
$products = $_SESSION['cart']->get_products();
echo '<a href="/cart/index.php?main_page=shopping_cart"> Items $0.00';
}
?>

</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>