X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Login Link (https://forum.x-cart.com/showthread.php?t=2355)

elabdesigns 07-28-2003 05:43 AM

Can we take it a bit further..?
 
Does the link change if the customer logs in? For ex. if you put the link that says Sign In, does is say Sign Out once they have signed in?

If not, can we make it so that it does? The one good thing about the auth box is that it lets the customer know that they have successfully signed in by saying logoff. I know the customer can see on the login page that they have signed in but once you go to another page the customer may see the Sign in link and think that they are not signed in.

Also, does any one know of a "my account" mod where the wish list, profiles and the orders history links from the shopping cart have been moved onto a "my account" page?

Thanks,

elab

sarahnk 01-29-2004 07:56 AM

can anyone please tell me how I can make this work for version 3.5.3 ?

i get a 'parse error' on 'line 3'

anyone, please?

sarahnk 01-29-2004 08:38 AM

i figured it out myself...

login.php
Code:

<?

require "./auth.php";

$smarty->assign("main", "mainlogin");
$smarty->display("customer/home.tpl");

?>


oziris 02-25-2004 03:19 PM

I tried this but placing changes in common_templates.tpl file disables webmaster mode functionality. ANy ideas?

I tried different approach and created login.php with this in it:

<?php
require "./auth.php";

require $xcart_dir."/include/categories.php";

$smarty->assign("main", "mainlogin");
$smarty->display("main/login.tpl");

?>

I copied login_incorrect code and created tpl file called login.tpl.

Now I get what I want: http://216.93.188.234/shopping/customer/login.php

But how do I get that to display within the regular page with header, footer etc...?

Thanks,
Predrag

SMDStudios 03-24-2004 01:42 PM

Getting the following error with this mod...

Warning: Smarty error: unable to read template resource: "shop/home.tpl" in /home/httpd/vhosts/shopgspot.com/httpdocs/Smarty-2.5.0/Smarty.class.php on line 1042


Can anyone help me out???

version: 3.5.4

domspe 03-29-2004 12:51 PM

I just get a blank page of nothingness!

Here is what my code looks like for my custom login.php
Code:

<?php

require "./auth.php";
require "./smarty.php";
require "./config.php";
@include "./https.php";
require "./auth.php";
require $xcart_dir."/include/categories.php";

$smarty->assign("main", "mainlogin");
$smarty->display("main/login.tpl");

?>


help! 8O

laureon 03-29-2004 01:11 PM

Are you on v3.5.5 by any chance?

Try this:

<?

require "./auth.php";
require $xcart_dir."/include/categories.php";
$smarty->assign("main", "mainlogin");
$smarty->display("customer/home.tpl");

?>

You will need to have something like this in your 'common_templates' file:

{elseif $main eq "mainlogin"}
{include file="customer/main/mainlogin.tpl"}

hope this helps

domspe 03-29-2004 01:56 PM

Hiya!
i am somewhere between 3.5.4 & 3.5.5 - xcart is doing funky mods.

i did exactly as you said: results are here:
http://shop.mpartworks.com/login2.php
Code:

<?

require "./auth.php";
require $xcart_dir."/include/categories.php";
$smarty->assign("main", "mainlogin");
$smarty->display("customer/home.tpl");

?>

and here is my blank page of nothingness:
http://shop.mpartworks.com/login.php
Code:

<?php

require "./auth.php";
require "./smarty.php";
require "./config.php";
@include "./https.php";
require "./auth.php";
require $xcart_dir."/include/categories.php";

$smarty->assign("main", "mainlogin");
$smarty->display("main/login.tpl");

?>


*grumble*
:)

laureon 03-29-2004 02:04 PM

I will post full code and instructions shortly.

laureon 03-29-2004 02:40 PM

Hi,

Creating a seperate 'Login' page:

Step 1 - Create a file named 'myaccount.php' in the folder '[xcart]/customer' in the root x-cart directory. i.e. NOT [skin1]/customer.

In the file 'myaccount.php' paste the following code, ensuring you leave no 'white spaces' at the bottom of the file.

Code:

<?
require "./auth.php";
require $xcart_dir."/include/categories.php";
$smarty->assign("main", "myaccount");
$smarty->assign("location",$location);
$smarty->display("customer/home.tpl");
?>


Step 2 - Creating a page to inform Smarty of which template to use:

In [skin1]/common_templates.tpl add the following after the
first if statement:

Code:

{elseif $main eq "myaccount"}
{include file="customer/main/myaccount.tpl"}


Step 3 - Creating the 'login' page

Create a new template 'myaccount.tpl' in [skin1]/customer/main. Then simply copy the login code from: '[skin1]/auth.tpl, inbetween the '{capture} and {/capture} tags as we don't want smarty to base the login page on the 'menu.tpl' template place it between the tags '
Code:

{include file="location.tpl"}
{capture name=dialog}

and
Code:

{include file="dialog.tpl" title="My Account" content=$smarty.capture.dialog extra="width=100%"}
which should give you something that looks like:

Code:

{assign var="last_location" value="My Account"}
{ include file="location.tpl" last_location=$last_location }
{capture name=dialog}
<TABLE border=0 cellPadding=0 cellSpacing=0 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>
{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 class=VertMenuItems>
<font class=VertMenuItems>{$lng.lbl_username}</font>

<input type=text name=username size=16>

<font class=VertMenuItems>{$lng.lbl_password}</font>

<input type=password name=password size=16>

<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=24 class=VertMenuItems>
{if $js_enabled}
{include file="buttons/login_menu.tpl"}
{else}
{include file="buttons/login_menu.tpl"}
{/if}
</td>
</tr>
{/if} {* use_secure_login_page *}
{if $usertype eq "C" or ($usertype eq "B" and $config.Modules.partner_register eq "Y")}
<tr>
<td height=24 nowrap class=VertMenuItems>
{include file="buttons/create_profile_menu.tpl"}
</td>
</tr>
{/if}
{if $usertype eq "P" and $active_modules.Simple_Mode eq "Y" or $usertype eq "A"}

<tr>
<td class=VertMenuItems>


<div align=left>{$lng.lbl_insecure_login}
</div>
</td>
</tr>

{/if}
{if $usertype eq "C"}
<tr>
<td class=VertMenuItems>


<div align=right>
{if $js_enabled}
{$lng.txt_javascript_disabled}
{else}
{$lng.txt_javascript_enabled}
{/if}
</div>
</td>
</tr>
{/if}
</form>
</table>
{/capture}
{include file="dialog.tpl" title="My Account" content=$smarty.capture.dialog extra="width=100%"}


You will need to create a link to call 'myaccount.php' and that is pretty much it.

This has been tested on v3.5.5.

You can of course change modify the template to your liking and should form the basis of a 'seperate' login page.

Any comments appreciated!


All times are GMT -8. The time now is 08:16 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.