Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2011
    Posts
    6
    Plugin Contributions
    0

    Default Dynamic Log In / Out button required

    Zen Cart v1.3.9e
    The site has never been upgraded
    The site is not live yet - nearly there :)

    I have trawled the fora, and have not found the answer, so here goes.

    I have my online shop set up in a subfolder named "products" of my domain - e.g. www.mydomain.com/products. I have my own banner and top menu that is used consistently across the entire site, and the zen cart menu and content resides below the main banner and menu system. All is good.

    What I have done is incorporate the "Log In / Out" link into my main top menu. This I have only been partly successful with.

    The issue is the "Log in / Out" will only appear in my top menu when users are browsing in the "products" area. If the user navigates to the "about us" or the "home" page (or anywhere outside of products), the function that determines whether to display "log in" or "log out" does not work, and a blank space is displayed instead.

    The code I have inserted into my top menu reads thus:

    [FONT="Courier New"]===

    <div class="menu_bar_right_button">
    <?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></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 } } ?>
    </div>

    ===[/FONT]

    I don't believe the issue is to do with the zen_href_link, FILENAME_LOGIN or FILENAME_LOGOFF bits, as I have replaced these entire sections with HTML without success. The issue appears to be with $_SESSION customer_id. Quite how to resolve this, I am not sure.

    Any assistance regarding this matter would be greatly received.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Dynamic Log In / Out button required

    Your URL?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Jun 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Dynamic Log In / Out button required

    www.mailmetric.com

    To get into the products area:

    username temp
    password chicken

    Payment gateway not set up yet, so products area is currently protected.

  4. #4
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Dynamic Log In / Out button required

    Why not just use Zen Cart for the "front" page and then you don't have to fiddle with sessions etc in another application?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  5. #5
    Join Date
    Jun 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Dynamic Log In / Out button required

    I did consider this once this issue was encountered. However, it would require quite a bit of re-work. Additionally, I plan to incorporate forum functionality plus other bits and pieces in the future. Shoving all of this into the root folder would get somewhat messy.

    It would be nice to be able to keep the zen cart functionality in it's own "products" folder, and be able to utilise the session whilst navigating outside of products. I know this is possible as the session is effectively still alive, but would like some guidance if possible.

 

 

Similar Threads

  1. HOME & LOG OUT button in homepage
    By missymissy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Apr 2014, 02:58 PM
  2. Log out button
    By Contenidos01 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Oct 2010, 12:01 AM
  3. Log Out button when not logged in
    By uniqueliving in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Feb 2010, 11:21 AM
  4. After log out can't log back in unless......
    By oldpaint in forum General Questions
    Replies: 13
    Last Post: 17 Mar 2007, 05:51 AM
  5. log in/log out 404 -NOT double directory issue
    By felixthehat in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 30 Sep 2006, 02:35 PM

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