Zen Cart Logo
Forums / General Questions / Header login woes

Header login woes

Locked

Views: 510

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
19 Sep 2009, 5:11 AM
#1
rickwilliams avatar

rickwilliams

New Zenner

Join Date:
Jul 2009
Posts:
48
Plugin Contributions:
0

Header login woes

Hi all, firstly thanks for any help to anyone that can help me with this issue.

Basically what I'd like to do is have my login box in my header (Already have it placed and it works) but once the user has logged in I would like the login box to dissapear and in it's place appear a logout button, your account link and maybe a your cart link/button aswell (Like what happens in php forums).

I've fiddled around with a few things and nothings worked quite the way I'd like it to or else it's unsuitable for my clients needs.

Website is currently hosted here at https://www.intricate-designs.co.nz/kamelotkidz whilst I prepare the site and get things ready for shipping it over to it's actual host etc.

Thanks again.

19 Sep 2009, 5:44 AM
#2
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Header login woes

One error noted line 1133 of your stylesheet

.greeting{ display::none;}
Do you have a test customer login we can use to see what happens once customer is logged in?

Tina

19 Sep 2009, 6:08 AM
#3
rickwilliams avatar

rickwilliams

New Zenner

Join Date:
Jul 2009
Posts:
48
Plugin Contributions:
0

Re: Header login woes

charmedbytina2:

One error noted line 1133 of your stylesheet

Do you have a test customer login we can use to see what happens once customer is logged in?

Tina

Thanks for the error note, all fixed ;)

test customer is as below.

login: racktor[at]hotmail.com
password: guest

As you'll notice once logged in you can't find a link to the my account or shopping cart or a logout button, I want the login area to disapear and those things to appear if possible.

Thanks

19 Sep 2009, 3:54 PM
#4
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Header login woes

Take a look at the tpl_header.php in templates / template_default / common.

Note the codes for the login - my account - shopping cart, etc...

Try replicating that coding in the file you have your email -password and the key image located - or merge that coding into the tpl_header.

Tina

19 Sep 2009, 10:59 PM
#5
rickwilliams avatar

rickwilliams

New Zenner

Join Date:
Jul 2009
Posts:
48
Plugin Contributions:
0

Re: Header login woes

charmedbytina2:

Take a look at the tpl_header.php in templates / template_default / common.

Note the codes for the login - my account - shopping cart, etc...

Try replicating that coding in the file you have your email -password and the key image located - or merge that coding into the tpl_header.

Tina

I owe you one mate! Now all I have to do it alter the logout link to be an image and she's working the way I want, this is what I did below.

Original Header login code from barebones zencart install

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

My altered code to show login form in header etc

<?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') {
                ?>
                    <?php echo zen_draw_form('login', zen_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); 
						  echo ENTRY_EMAIL_ADDRESS; 
						  echo zen_draw_input_field('email_address', '', 'size="12" id="login-email-address"'); 
						  echo ENTRY_PASSWORD; 
						  echo zen_draw_password_field('password', '', 'size="12" id="login-password"'); 
						  echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); 
						  echo zen_image_submit(BUTTON_IMAGE_LOGIN, BUTTON_LOGIN_ALT);
                        ?>
                    
                <?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 }?>

She now works a right charm, thanks alot again you pointed me in the right direction and let me think about things without doing it all for me, which makes me learn more, thanks mate