Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

My Account Login

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-01-2004, 06:34 AM
 
elabdesigns elabdesigns is offline
 

Advanced Member
  
Join Date: May 2003
Location: Mount Airy, NC
Posts: 66
 

Default 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
Reply With Quote
  #2  
Old 11-14-2004, 06:29 AM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default 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 $ *} {$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%"}
In order to referrence this page, you'll need to create referrences to it in the Help/index.tpl. Add something like the following and change whatever is currently the "if" section to be an "elseif":

Code:
{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"}

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 $ *} {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 }

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 $ *} {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 }
Last, but not least - in the created authbox_mod.tpl file:
Code:
{* $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}
That should do it! If you follow all of these directions, you will be working with modified template files and your original ones will be unharmed (If not, be sure to backup prior to doing any modification). You can now add a speed bar link or other to "My Account" with the URL: help.php?section=Login

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
__________________
4.1.9
Reply With Quote
  #3  
Old 12-22-2004, 03:35 AM
 
clubsrefinished clubsrefinished is offline
 

Member
  
Join Date: Dec 2004
Location: West Midlands, UK
Posts: 15
 

Default

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.
__________________
Mike
--------------
Version: 4.0.11 Live, RMA, AOM & X-Affiliate
PHP 4.3.4
MySQL server 3.23.58
MySQL client 3.23.58
Web server Apache/1.3.29 (Unix)

Site: http://www.clubsrefinished.co.uk
Reply With Quote
  #4  
Old 12-24-2004, 06:30 AM
 
mpcommercial mpcommercial is offline
 

Member
  
Join Date: Dec 2004
Posts: 28
 

Default

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
__________________
Lorena Martinez
X-Cart v4.3.2
www.lapislazuliworld.com
Reply With Quote
  #5  
Old 01-06-2005, 08:35 PM
  eaglemobiles's Avatar 
eaglemobiles eaglemobiles is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 167
 

Default 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
__________________
X-Cart Gold 4.3.2
X-Cart Gold 4.4.1
Unix

High Quality CCTV DVRs & Cameras
http://www.eaglemobiles.co.uk/CCTV
Reply With Quote
  #6  
Old 01-08-2005, 03:36 AM
 
zefon zefon is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 86
 

Default

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?
__________________
X-Cart Gold 4.1.8
Reply With Quote
  #7  
Old 01-12-2005, 08:13 AM
 
mpcommercial mpcommercial is offline
 

Member
  
Join Date: Dec 2004
Posts: 28
 

Default

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.

Regards,

Lorena
__________________
Lorena Martinez
X-Cart v4.3.2
www.lapislazuliworld.com
Reply With Quote
  #8  
Old 01-24-2005, 07:57 PM
 
jdedba jdedba is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 96
 

Default

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.
__________________
version 4.1.1
Reply With Quote
  #9  
Old 02-16-2005, 08:36 AM
 
mpj mpj is offline
 

Senior Member
  
Join Date: Feb 2005
Posts: 106
 

Default

once logged in, i get these error:
Code:
Warning: Smarty error: unable to read resource: "buttons/button_vunc.tpl" in ****** on line 1082 Warning: Smarty error: unable to read resource: "buttons/button_vunc.tpl" in ****** on line 1082 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 !
__________________
X-Cart 4.0.11


{My simple mods}
Adding Market list and % save on product detail
Quantity input box
Reply With Quote
  #10  
Old 02-16-2005, 09:01 AM
 
mpj mpj is offline
 

Senior Member
  
Join Date: Feb 2005
Posts: 106
 

Default

sorry

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.
__________________
X-Cart 4.0.11


{My simple mods}
Adding Market list and % save on product detail
Quantity input box
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:53 PM.

   

 
X-Cart forums © 2001-2020