My Account Login
At one time I remember someone posting a topic with a way to make a "My account Login" link, that sent you to a login form, verses having the login authbox on the side menu.
Does anyone know that toppic thread or now how I can do this? Thanks |
Login on separate "My Account" page
Elab,
Here's what I have done: 1. Create a new template in the skin1/Help direcetory and call it Login.tpl. Put the following code in it, note the (3) template files that it referrences - they are customizations of the respective files, minus the "_mod" would equal the original template. Also, there are some languages that I used: see {$lng.txt_login_header_1} etc. for the Login.tpl: Code:
{* $Id: Login.tpl,v 1.0 2004/11/14 16:03:50 mclap Exp $ *} Code:
{if $section eq "Login"} By doing the last step, you will be able to call the Login page as: http://yourdomain.com/xcart/help.php?section=Login Now what about the three templates referrenced as: auth_mod.tpl, menu_profile_mod.tpl and authbox_mod.tpl? They should all be located in the root skin1 directory, like their original files that I have modified. First create additional templates with three names (like my "_mod" extension for the modified template) or some variation of the original templates, but be sure to change the name respectively in the created Login.tpl. Now, what do you put in the three _mod files? Well, for starters, you'll need to modify the code to take it out of a menu template with the boxes and borders. I have made some additional changes to get the new templates to fit the new format and I'll put the files below. Keep in mind, you may need to adjust some of the html to get your desired table widths and check the "languages" referrenced. I created new language varaibles, like lng.txt_login_header_1 and others, so be sure to either use the original template variable or create a variable to your liking. My three modified files are below, use them, tweak them as you wish. They are only a good starting point as I created them to fit within my site framework. I know that they will at least get you started. For file auth_mod.tpl, insert the code: Code:
{* $Id: auth_mod.tpl,v 1.39 2004/06/28 11:38:38 mclap Exp $ *} In the menu_profile_mod.tpl file, you'll need to remove the menu look that was originally used in the column-menu design. Also, you will see three language texts added: {$lng.txt_menu_profile_option1}, {$lng.txt_menu_profile_option2} and {$lng.txt_menu_profile_option3}. These show up in "My Account" after the user has logged in. I created the language text to say the following: {$lng.txt_menu_profile_option1} = "Change your password, billing or shipping addresses." {$lng.txt_menu_profile_option2} = "Need to remove or delete your current profile?" and {$lng.txt_menu_profile_option3} = "View, print or modify your (Company Name) orders." So change accordingly. Here's my menu_profile_mod.tpl file: Code:
{* $Id: menu_profile_mod.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} Code:
{* $Id: authbox_mod.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} Let me know if you have any problems. This works well for me and I have referrenced in the functionality for the user to return to "My Account" at any time to Modify/Delete their profile, search for orders and of course Login/Logout. If anyone has any improvements of this work, I would love to see them here! Nothing is ever finished. This is just one step that I have done to get the clunky X-Cart style menus reduced to their core: Products, products and products - that's all that should be in the category/side menus. Additional functionality should be achieved by using headers, footers and a good site map. The best way to prevent users from getting lost in your web city is just to take them their to begin with ... - Mike |
mffowler,
This looks like a great mod which I have almost got to work on my site except within your 'menu_profile_mod.tpl' you include the following file="buttons/button_vunc.tpl" I am assuming that this is also a modified file or is calling a file that you have previously amended but unfortunately is not listed within your extensive expanations above. Can you please advise what is included within this file or what .tpl your button_vunc is based upon. Look forward to your response. :wink: |
I am also interested in this solution! So far, I implemented the MOD and I am able to log in and create an account correctly, but once I am logged in, I obtain the following error if I try to view the /help.php?section=Login:
Warning: Smarty error: unable to read template resource: "menu_profile_mod.tpl" in /home/lapislaz/public_html/store/Smarty-2.5.0/Smarty.class.php on line 1042 Warning: Smarty error: unable to read template resource: "authbox_mod.tpl" in /home/lapislaz/public_html/store/Smarty-2.5.0/Smarty.class.php on line 1042 |
Re: Login on separate "My Account" page
I get this error. Warning: Smarty error: unable to read resource: "menu_mod.tpl" in /hsphere/local/home/eaglemob/eaglemobiles.co.uk/e-shop/Smarty-2.6.3/Smarty.class.php on line 1082
Thanks |
I did this using a different approach. I just have a link to the following in my header and it works fine:
store/customer/secure_login.php? |
I was able to solve the eroor I was getting: all this was because I use ?Login instead of ?login! I sometimes forget that X-cart is case sensitive.
Now, a question: How would I display "user logged in !" message, along with the Logoff buttom, one a customer is logged in? Where do you recommend displaying this message? Ussually, it can be found right inside the menu we are trying to eliminate. 8) Regards, Lorena |
Good mod. Thanks.
Code:
{include file="menu_mod.tpl" menu_title=$lng.lbl_authentication menu_content=$smarty.capture.menu} In 4.0.11, menu_mod.tpl should be menu.tpl. |
once logged in, i get these error:
Code:
Warning: Smarty error: unable to read resource: "buttons/button_vunc.tpl" in ****** on line 1082 What is this "buttons/button_vunc.tpl" ? Please advise. Thanks for a great mod ! |
sorry :lol:
i just changed it to " buttons/button.tpl " and realized what a dumb mistake I have made. that was just the buttons image :) thanks again for a great mode. |
Is there a way to display customer profile ?
|
mpj,
Once the customer logs in then the profile comes up as an option ... - Mike |
thanks for the reply.
I didn't state my question correctly. :) Once a customer logins, they have the options of : ------------------- Update your profile Delete profile Orders history ------------------- I was wondering is there is a way to display the current customer profile ------------------- Name Last Name Address Click here to edit your existing profile ------------------- Thanks |
Sure, just call the content in the same way it is called where it is shown. I would explian exactly how, but it helps to look at it and figure it out. Then you'll be able to do a lot more ...
- Mike |
Hi Mike:
Thanks for the mod you shared, I got the login part done, a link called my account, then user enters, click login, after login, it goes to file Login.tpl Code:
{else} |
In your case, I would probably not have only a "My Login" scenario, but also the equivalent on the home/main page. That way a user could log in there and have what you desire without the added step to log in.
I wanted to have an option to create more account content in a unique place outside of the home.tpl, as it is already littered with too many menu boxes. Once users use a remote login area (Speed Bar perhaps?), they can easily know where and how to log in. Prior to loggin in or registering, they can shop and explore and register during first time checkout. I neever understood a "Register" at a store option prior to shopping. That's like leaving your wallet (or details) at the checkout stand before hitting the aisles. Unless there is added value, I never thought it necessary to encourage registration without shopping or joining a community. There are other ways to create a login page as mentioned by some of the posts in this thread, but creating a unique tpl file allows to integrate unique content for customers and make other things accessible when logged in. I know that doesn't answer your question. Yes, you can do what you desire, but it is redundant and not very useful to a customer. They might as well have stayed at the home page to begin with ... - Mike |
great mod but can someone help me with the login button
everything works except the login button, it logs in if you just press enter but the button no longer works. I've spent most of today trying to work out why!
any help will be much appreciated thanks! |
PM me a URL and I'll take a look... Mike
|
a simple way to create a log in page is.
add a link Code:
<table border="0" align="right" cellpadding="0" cellspacing="0"> edit checkout.tpl. get the bit of code at the top and wrap it with the following to remove the cart part showing if the page is being used for log in add to top Code:
{if $smarty.get.mode ne "auth"} original code Code:
{capture name=checkout_dialog} add beneath Code:
{/if} |
sorry to be a pain.
ok I made the following files: Login.tpl, Login_message.tpl, index.tpl, auth_mod.tpl, menu_profile_mod.tpl, and authbox_mod.tpl I have alos updated them all so they dont point to menu_mod.tpl but to menu.tpl I also switched button_vunc.tpl to button.tpl so when this is all done I get an error on the index.tpl : no closing if bracket Code:
{if $section eq "Login"} so i added a {/if} the error is fixed but when my page loads I get nothing. Any ideas. I should be getting a login form. Thanks for any help. Here is my link: http://dejaun.com/store/help.php?section=Login |
Are you returning to the "My Account" login page? I registered and then went to your "My Account" link but that isn't the Login page that you made... but when I went to your original login link, I saw everything.
I think uit's the https redirect setting in general settings that is forcing it back to http and the home.php, but everything is working just not linked to the page that you want. - Mike |
sorry didnt update that link till it works.
Yes I got it, but i had to use the original files and not the _mod ones I made. Dont know why. Now I just need to stylize them. This will work as I dont use them on my home.tpl Thanks again. Great mod. |
A lot of folks make this out as just a "Login" mod, but it's much more. Think about the potential of having special content for your users or advertising, marketing of something they like. This is also a great place to introduce a support ticket system or better service a customer.
Getting customers to use the "My Account" section of our sites has dropped the heavy service e-mails and requests that were bogging us down. Once they know how and where to track orders and search info., they will go there. Yes, you can have this in the menu method that the default XC uses, but for a while there- every new X-Cart function was being added as a new "Menu" area cluttering the sides of the store. Just too many menus and so I think it is useful to move login, get the minicart out of the gutter, rework manufacturers, as well as perhaps placing the gift certificates outside of "special". My opinions, but XC's menus are decent for admin, but lack on the end-user side. - Mike |
Hi there;
this is exactly what I'm looking for, but because I'm newbie .... Is the code posted by mffowler at the beginning, still good ( I mean updated ? I got confused because there's also a code posted by Shan. Sorry guys :oops: Maybe one of the X-cart Guru can post a revised code for guys like me. Thanks ! |
Shan's post is great if you want a login page (just login). hut, if you want the features of separate account info/details then you'll need something like my mod. You can also just reference the secured login php to get a separate login.
My mod is still intact but you need to change the button_vunc tpl reference to whatever button template you use. Other than that, you should be fine... I'll change that one of these days. - Mike |
thanks mike you were a big help with it.
|
Thanks mffowler !
This will be my first big project ! :oops: for the next week. Thanks again for share with others. Aldo |
I hope it helps you. Keep in mind:
If you just want a login page, then use the secured login or Shan's cart.php mod login. Those are much easier solutions. I like having a customer center as it gives you a chance to provide more upselling opportunities to your customers. It's more about the potential of future activities. Look at Amazon and their "Where's my stuff?" or account access... they sell at every possible point at that is where X-Cart needs to improve upon. Images, customer service and upselling and the integration of all three. Jon's upsell mod would be great to integrate into other areas of the site or at least place the upselling templates in additional areas. - Mike |
Me too, I like the "Customer Center" idea, and actually just started
"trying" to implement your Mod. But I'm already facing my first problem. My Help/index.tpl is: Code:
{* $Id: index.tpl,v 1.6 2004/03/16 10:43:08 svowl Exp $ *} What should I do ? replace the "If" on my code by your example Code:
{if $section eq "login"} and add those 2 "elseif" on your example. and my 2nd. question is : I don't have "help/login_message.tpl" Did I miss something ? Thanks is advance ! :D Aldo |
Just include the login/tpl as an elseif. the login_message.tpl only refernces the login errors, it shouldn't prevent the mod from working.
This can use some work or at least be cleaned up, but it is a good mod to get use to the functionality of Smarty templates and shouldn't take long to see what is going on. - Mike |
Thanks man !!
Aldo |
I created the
Login.tpl index.tpl auth_mod.tpl menu_profile_mod.tpl authbox_mod.tpl and inserted the code posted code by mmfowler into my skin1/help directory but when I key in the address on my site I get the following error. Error msg: Warning: Smarty error: unable to read resource: "auth_mod.tpl" in /home/rmbmco/public_html/m/xcart/Smarty-2.6.9/Smarty.class.php on line 1088 I checked to make sure that all my files were in the right folder and I just don't know what is going on. I tried to overited the auth_mod.tpl file several times and nothing. Need some help, don't know what to do? http://www.michaelmoskva.com/xcart/help.php?section=Login |
Here is the code that I have embedded within the Listed TLP files; It might make it easier to view my problem. Thanks for the help.
Login.tpl index.tpl auth_mod.tpl menu_profile_mod.tpl authbox_mod.tpl Login.tpl {* $Id: Login.tpl,v 1.0 2004/11/14 16:03:50 mclap Exp $ *} {$lng.txt_login_header_1} {capture name=dialog} {if $login eq "" } <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR><TD>{$lng.txt_login_header_2}</TD></TR> <TR> <TD>{ include file="auth_mod.tpl" }</TD> </TR> </TABLE> {else} <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR> <TD width="50%">{ include file="menu_profile_mod.tpl" }</TD> <TD width="50%">{ include file="authbox_mod.tpl" }</TD> </TR></TABLE> {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_login_account content=$smarty.capture.dialog extra="width=100%"} index.tpl {* $Id: index.tpl,v 1.6 2004/03/16 10:43:08 svowl Exp $ *} {include file="page_title.tpl" title=$lng.lbl_help_zone} {if $section eq "Login"} {include file="help/Login.tpl"} {elseif $section eq "Login_message"} {include file="help/Login_message.tpl"} {elseif $section eq "Login_error"} {include file="help/Login.tpl"} {elseif $section eq "Password_Recovery"} {include file="help/Password_Recovery.tpl"} {elseif $section eq "Password_Recovery_message"} {include file="help/Password_Recovery_message.tpl"} {elseif $section eq "Password_Recovery_error"} {include file="help/Password_Recovery.tpl"} {elseif $section eq "FAQ"} {include file="help/FAQ_HTML.tpl"} {elseif $section eq "contactus"} {include file="help/contactus.tpl"} {elseif $section eq "about"} {include file="help/about.tpl"} {elseif $section eq "business"} {include file="help/business.tpl"} {elseif $section eq "conditions"} {include file="help/conditions.tpl"} {elseif $section eq "publicity"} {include file="help/publicity.tpl"} {else} {include file="help/general.tpl"} {/if} auth_mod.tpl {* $Id: auth_mod.tpl,v 1.39 2004/06/28 11:38:38 mclap Exp $ *} {capture name=menu} <TABLE border="0" cellpadding="0" cellspacing="1" width="100%"> {if $config.General.use_https_login eq "Y"} {assign var="form_url" value=$https_location} {else} {assign var="form_url" value=$current_location} {/if} <FORM action="{$form_url}/include/login.php" method="post" name="authform"> <INPUT type="hidden" name="{$XCARTSESSNAME}" value="{$XCARTSESSID}"> {if $config.General.use_secure_login_page eq "Y"} {* use_secure_login_page *} <TR> <TD> {if $usertype eq "C"} {assign var="slogin_url" value=$catalogs_secure.customer} {elseif $usertype eq "P" and $active_modules.Simple_Mode eq "Y" or $usertype eq "A"} {assign var="slogin_url" value=$catalogs_secure.admin} {elseif $usertype eq "P"} {assign var="slogin_url" value=$catalogs_secure.provider} {elseif $usertype eq "B"} {assign var="slogin_url" value=$catalogs_secure.partner} {/if} {include file="buttons/secure_login.tpl"} </TD> </TR> {else} {* use_secure_login_page *} <TR> <TD> <TABLE width="100%" border="0" align="right"> <TR><TD align="right">{$lng.lbl_username}</TD><TD align="left"><INPUT type="text" name="username" size="16" value="{#default_login#}"></TD></TR> <TR><TD align="right">{$lng.lbl_password}</TD><TD align="left"><INPUT type="password" name="password" size="16" value="{#default_password#}"> <INPUT type="hidden" name="mode" value="login"> {if $active_modules.Simple_Mode ne "" and $usertype ne "C" and $usertype ne "B"} <INPUT type="hidden" name="usertype" value="P"> {else} <INPUT type="hidden" name="usertype" value="{$usertype}"> {/if} <INPUT type="hidden" name="redirect" value="{$redirect}"></TD></TR> <TR> <TD height="50"></TD> <TD height="50" align="left"> {if $js_enabled} {include file="buttons/login_menu.tpl"}[img]{$ImagesDir}/resources/dot_clear.gif[/img]{else} {include file="buttons/login_menu.tpl"} {/if} {/if} {* use_secure_login_page *} {if $usertype eq "C" or ($usertype eq "B" and $config.XAffiliate.partner_register eq "Y")} {include file="buttons/create_profile_menu.tpl"} {/if} </TD> </TR> {if $login eq ""} <TR> <TD></TD> <TD height="24" nowrap align="left"> {$lng.lbl_recover_password} </TD> </TR> {/if} </TD></TR></TABLE> {if $usertype eq "P" and $active_modules.Simple_Mode eq "Y" or $usertype eq "A"} <TR> <TD colspan="2"> <DIV align="left">{$lng.lbl_insecure_login} </DIV> </TD> </TR> {/if} {if $usertype eq "C"} <TR> <TD align="right" colspan="2"> {if $js_enabled} {$lng.txt_javascript_disabled} {else} {$lng.txt_javascript_enabled} {/if} </TD> </TR> {/if} </FORM> </TABLE> {/capture} { include file="menu_mod.tpl" menu_title=$lng.lbl_authentication menu_content=$smarty.capture.menu } menu_profile_mod.tpl {* $Id: menu_profile_mod.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} <TABLE width="85%" align="center" border="0"> <TR><TD> {include file="buttons/button_vunc.tpl" button_title=$lng.lbl_modify_details href="register.php?mode=update"} {$lng.txt_menu_profile_option1} {include file="buttons/button_vunc.tpl" button_title=$lng.lbl_delete_profile href="register.php?mode=delete"} {$lng.txt_menu_profile_option2} {if ($usertype eq 'A' || ($usertype eq 'P' && $active_modules.Simple_Mode)) && $is_merchant_password eq 'Y'} {$lng.lbl_change_mpassword} {/if} {if $usertype eq "C"} {include file="buttons/button_vunc.tpl" button_title=$lng.lbl_orders_history href="orders.php"} {$lng.txt_menu_profile_option3} {if $user_subscription ne ""} {include file="modules/Subscriptions/subscriptions_menu.tpl"}</A> {/if} {/if} </TD></TR></TABLE> {/capture} { include file="menu_mod.tpl" menu_title=$lng.lbl_your_profile menu_content=$smarty.capture.menu } authbox_mod.tpl {* $Id: authbox_mod.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} <TABLE border="0" cellpadding="0" cellspacing="0" width="100%"> <FORM action="{$xcart_web_dir}/include/login.php" method="post" name="loginform"> <TR> <TD></TD> <TD valign="top"> <h1>{$login}{$lng.txt_logged_in}</h1> {if $js_enabled} {include file="buttons/logout_menu.tpl"} {else} {include file="buttons/logout_menu.tpl"} {/if} </TD> </TR> {if $usertype eq "C"} <TR> <TD colspan="2" align="right"> {if $js_enabled} {$lng.txt_javascript_disabled} {else} {$lng.txt_javascript_enabled} {/if} </TD> </TR> {/if} <INPUT type="hidden" name="mode" value="logout"> <INPUT type="hidden" name="redirect" value="{$redirect}"> </FORM> </TABLE> {/capture} {include file="menu_mod.tpl" menu_title=$lng.lbl_authentication menu_content=$smarty.capture.menu} |
Make sure that file is in the correct place, and make sure it has the correct permissions.
|
Thanks Ryan,
I got it. |
Thanks for this mod!!
I am totally confused though. I did everything in the first post as well as updating it for XC 4. Now when I go to login, the URL is completely off after you sign in and it says the page does not exist. 8O This is the page it tries to take you to after you press 'submit' : https://www.beachgirlbeauty.com/storehttp://www.beachgirlbeauty.com/store/secure_login.php ha! Where do I edit this link at? :?: Also, the "My Account" link doesn't go to a login page when you're NOT logged in. http://www.beachgirlbeauty.com/store/help.php?section=login What could I have wrong? TIA! |
First off, you are calling:
http://www.beachgirlbeauty.com/store/help.php?section=login When you created the section for: http://www.beachgirlbeauty.com/store/help.php?section=Login (Note the capital L in Login). But, you are still getting a smarty error: Quote:
Either:
See if those are the issues. - Mike |
Thanks so much for the reply!
Edited - I created a menu_mod.tpl and copy/pasted the code from menu.tpl to the mod file. Now it appears to be working! The only thing is - once you are logged in, it forwards you to the home page, and not the 'my account' page. How can I fix that? Thank you again for your help. I would have never known it was the menu_mod.tpl if it wasn't for you! |
Try enabling the general setting: Do not redirect customers from HTTPS to HTTP.
- Mike |
Thank you...however, I'm not so sure that worked. :oops: Also my login page is completely screwed up and it's messing up my table code. I can't figure out how to fix it. Wahhh... :(
Also, please don't kill me for all the questions...but how do I make the Login.tpl have the actual login forms on it instead of them having to go through that extra step of clicking on "Secure Login" and all of that? Thank you in advance!!!! |
All times are GMT -8. The time now is 09:39 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.