Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Apr 2009
    Location
    Edinburgh
    Posts
    130
    Plugin Contributions
    0

    Default Changing link from "login" (when not logged in) to "my account" (when logged in)

    Hi there

    What is the solution to have a 2 deffirent links that change when you are logged or not logged in? ie. When the new customer come to the website there is link - LOGIN. With this link he can create an account and do shopping on the website.

    The problem is I would love to have this link to change to MY ACCOUNT, after customer log in.

    Anyone know the solution?
    Thank you

    here is the link to the shop:
    http://www.millers-graphics.co.uk

  2. #2
    Join Date
    Jul 2009
    Posts
    234
    Plugin Contributions
    1

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    im pretty sure it does anyway.......when someone is logged in it changes to Log Out, and My Account will also appear.

    Have done a test account yourself?

  3. #3
    Join Date
    Apr 2009
    Location
    Edinburgh
    Posts
    130
    Plugin Contributions
    0

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    Quote Originally Posted by Ooba_Scott View Post
    im pretty sure it does anyway.......when someone is logged in it changes to Log Out, and My Account will also appear.

    Have done a test account yourself?
    Yes. It's still the same when I am logged in or off. Any suggestions?
    Thank for the respons

  4. #4
    Join Date
    Apr 2009
    Location
    Edinburgh
    Posts
    130
    Plugin Contributions
    0

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    The links are in the sidebox INFORMATION - tpl_information

  5. #5
    Join Date
    Jul 2009
    Posts
    234
    Plugin Contributions
    1

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    hmm have you changed anything in the tpl_header.php file? (your template - common)

    As in here about line 80 ( <!-- bof navigation display -->) this is where the logic is to switch between login, log out, my account


    ....maybe you have accidnelty changed abit of this without noticing?

  6. #6
    Join Date
    Jul 2009
    Posts
    234
    Plugin Contributions
    1

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    Thats probaly the reason why they are not changing, as it isnt to do with the header file ( sorry u must have been typing when i was)


    You should be able to add that logic from the header file into the sidebox information file, where the login link is

  7. #7
    Join Date
    Apr 2009
    Location
    Edinburgh
    Posts
    130
    Plugin Contributions
    0

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    I'll give it a try. Thanks

  8. #8
    Join Date
    Apr 2009
    Location
    Edinburgh
    Posts
    130
    Plugin Contributions
    0

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    Yupi!

    Works so far, but still its not in a place. Here is the code:

    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 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_information.php 2982 2006-02-07 07:56:41Z birdbrain $
    */
    $content = '';
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
    $content .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
    $content .= '<li>- <a href="/">Home</a></li>' . "\n";
    $content .= '<li>- <a href="http://www.millers-graphics.co.uk/index.php?main_page=page_3">About Us</a></li>' . "\n";
    ?>

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

    for ($i=0; $i<sizeof($information); $i++) {
    $content .= '<li>- ' . $information[$i] . '</li>' . "\n";
    }

    $content .= '<li>- <a href="http://www.millers-graphics.co.uk/index.php?main_page=page_2">How To Find Us</a></li>' . "\n";

    $content .= '</ul>' . "\n";
    $content .= '</div>';
    ?>
    Could you help to sort it out? Thanks

    And link to the website:
    http://www.millers-graphics.co.uk

  9. #9
    Join Date
    Jul 2009
    Posts
    234
    Plugin Contributions
    1

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    so what happens when you login now? ......what happens to the login, log off and my account links?

  10. #10
    Join Date
    Apr 2009
    Location
    Edinburgh
    Posts
    130
    Plugin Contributions
    0

    Default Re: Changing link from "login" (when not logged in) to "my account" (when logged in)

    When I enter the website, there is a "Login" link only. When I sign in, I can see "Log out" and "Manage my accounts" links. I have checked them and they seem to be working. But, I am not developer, especially PHP developer. I was able to merge the code of both files - tpl_header and tpl_information, but I dont know how to make look how I want.

    First of all, all links - Login, Log off and My Account - appear outside the information sidebox.

    If this is something you could help with..please :

    website address:
    http://www.millers-graphics.co.uk

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Changing "Default Order Status" from "Delivered" to "Shipped"
    By CookieMonster in forum Customization from the Admin
    Replies: 1
    Last Post: 25 Nov 2014, 12:22 AM
  2. Replies: 2
    Last Post: 11 Feb 2010, 09:13 PM
  3. Remove "Newsletters" link when logged into "My Account" (not in Admin?)
    By hedron in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 17 Sep 2009, 10:44 PM
  4. php code for "if logged in" vs "if not logged in"
    By p m in forum General Questions
    Replies: 11
    Last Post: 26 Aug 2008, 11:36 AM

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