Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    18
    Plugin Contributions
    0

    Default Moving navigation tabs to different areas

    Hi. I would like to move the top navigation (home, login, checkout, my account etc.) to the same bar as the ezpages (Zen Cart, ezpages, privacy notice etc.).

    I have traced the code for both of these entries and understand that I can simply turn off the top navigation and add new entries for home, checkout, my account... into the ezpages table of the database which would solve my problem. This however leaves an issue with the functionality of the login/logout code. The top bar alternates these two options if a user is logged in or out and displays the my account option if logged in. It also uses an if...else statement to decide whether to display the checkout or cart based on the cart contents.

    How can I move this functionality to the ezpages bar? I assume that it means using the override system on the ezpages_bar_header.php file. Is it just a matter of copying the code from the tpl_header.php file into that one or does it need altering in some way? I assume (making a lot assumptions at the moment) that it would be a matter of removing the <ul><li> from the code and proceeding with the php section of the code after the FOR loop for the standard ezpages section has completed.

    Once this is complete, is it possible to move the search bar onto the same area?

    I think I'm almost there but attempts to do this have been painfully slow.

  2. #2
    Join Date
    Jun 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Moving navigation tabs to different areas

    Ok. Managed to solve it myself.

    For anyone who would like to know:

    *create a copy of the tpl_ezpages_bar_header.php file in your override directory (includes\templates\YOUR TEMPLATE\templates\)

    *create a copy of the tpl_header.php file in your override directory (includes\templates\YOUR TEMPLATE\common\)

    *copy the following code from the tpl_header.php file:

    PHP Code:
    <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>
    *paste it into the tpl_ezpages_bar_header.php file after the FOR loop has completed but before the </div> statement, then remove all html relating to the <ul> like this:

    PHP Code:
    <?php
    /**
     * Page Template
     *
     * Displays EZ-Pages Header-Bar content.<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_ezpages_bar_header.php 3377 2006-04-05 04:43:11Z ajeh $
     */

      /**
       * require code to show EZ-Pages list
       */
      
    include(DIR_WS_MODULES zen_get_module_directory('ezpages_bar_header.php'));
    ?>
    <?php 
    if (sizeof($var_linksList) >= 1) { ?>
    <div id="navEZPagesTop">
    <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) {  ?>
      <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php 
    // end FOR loop ?>


    /*PASTE CODE HERE*/


    <?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?></a>
    <?php if ($_SESSION['customer_id']) { ?>
        <a href="<?php echo zen_href_link(FILENAME_LOGOFF'''SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF?></a>
        <a href="<?php echo zen_href_link(FILENAME_ACCOUNT'''SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT?></a>
    <?php
          
    } else {
            if (
    STORE_STATUS == '0') {
    ?>
        <a href="<?php echo zen_href_link(FILENAME_LOGIN'''SSL'); ?>"><?php echo HEADER_TITLE_LOGIN?></a>
    <?php } } ?>

    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART'''NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS?></a>
        <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT?></a>
    <?php }?>


    /*AND BEFORE HERE*/



    </div>
    <?php ?>
    *Save the tpl_ezpages_bar_header.php file as we have now finished with that.

    *Return to the tpl_header.php file and comment out (or I suppose you could delete) all of the code you just copied like this:

    PHP Code:
    <!-- Commented out so it can be moved to the ezpages bar
    <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>
    End of commenting out -->
    Notice that I've put two types of comment - one for the html <!-- --> and one for the php which you can see after the first php open block /* which closed before the last php close block */.

    *To remove the other options (ezpages, privacy etc...), use phpmyadmin to delete the entries from the ezpages table in your database.

    Took me most of the day to work that one out. Must be having an off day.

  3. #3
    Join Date
    Aug 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Moving navigation tabs to different areas

    Hello....I tried out your style and it works....thank so much. Very good works, but i have one problem. How do I put space between the home, login, and check out....they are too close to each other.
    thank you ..........

 

 

Similar Threads

  1. Navigation wrapper tabs help
    By steve1114 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Jul 2011, 11:19 AM
  2. UK Shipping Costs for different Areas of the UK
    By sausage_dog in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 14 Apr 2009, 12:27 PM
  3. Moving the different navigation tabs
    By m4tty in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Jul 2008, 08:57 AM
  4. How to remove empty line above categories tabs navigation?
    By PaulRiedel in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 12 Aug 2007, 08:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR