Jump to content
xt:Commerce Community Forum

Login Box


sevenfour

Recommended Posts

Hier meine loginbox.php . Musst die zugehörige Templatedatei natürlich noch anpassen.

if(!empty($_SESSION['registered_customer'])){


	$customer_data = (get_object_vars($_SESSION['customer']));

	$customer_data = $customer_data['customer_info'];

	$show_box = true;

	$status = 1;

	$address_data = $_SESSION['customer']->_getAdressList($_SESSION['registered_customer']);

	$tpl_data = array('addresses_data' => $address_data, 'customer_data' => $customer_data, 'status' => $status);

	}


else{


	$show_box = true;

	$status = 0;

	$tpl_data = array('status' => $status  );


}

Link to comment
Share on other sites

hallo.

habe auch das script in die loginbox.php eingfügt. soweit auch gut.

ich bräuchte da ein wenig hilfe, die box_loginbox.html anzupassen.

da ja nun nach dem login noch alle formularfelder angezeigt werden. es müsste eben die ausgabe z.b. sie sind eingeloggt als usw. ausgebeben werden.

würde mich über hilfe sehr freuen.

mfg

Link to comment
Share on other sites

glaub ich stell mich jetzt dazu zu dumm an. wenn ich die If Abfrage in die box_loginbox.html einbinde zerhaut es mir den ganzen shop.

könnte man nicht mal den ganzen Code posten. Vielen Dank

So hatte ich es eingbunden, aber so zerhaut es mir den Shop total.

Was ist da Falsch?

<h2 class="boxheader">{txt key=TEXT_BOX_TITLE_LOGIN}</h2>
<div class="boxbody">
{if $status = 1}
Sie sind angemeldet
{$addresses.customers_gender}{$addresses.customers_lastname}

{else}
{form type=form name=create_account action='customer' paction='login' link_params=getParams method=post conn=SSL}
{form type=hidden name=action value=login}
{form type=hidden name=link_target value=index}

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>{txt key=text_email}:</td>
</tr>
<tr>
<td>{form type=text name=email maxlength='50' style='width:170px;'}</td>
</tr>
<tr>
<td>{txt key=text_password}:</td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>{form type=password name=password maxlength='30' style='width:80px;'}</td>
<td>{button text=$smarty.const.BUTTON_LOGIN file='login.gif' type='form'}</td>
</tr>
</table></td>
</tr>
<tr>
<td ><div class="hr"></div><a href="{link page='customer' paction='password_reset' conn=SSL}">{txt key=text_link_lostpassword}</a></td>
</tr>
</table>
{/if}
{form type=formend}
</div>[/PHP]

Link to comment
Share on other sites

Das hatte ich übberlesen.

Probier mal das hier:

<h2 class="boxheader">{txt key=TEXT_BOX_TITLE_LOGIN}</h2>
<div class="boxbody">
{if $status == "1"}
Sie sind angemeldet
{$addresses.customers_gender}{$addresses.customers_lastname}

{else}
{form type=form name=create_account action='customer' paction='login' link_params=getParams method=post conn=SSL}
{form type=hidden name=action value=login}
{form type=hidden name=link_target value=index}

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>{txt key=text_email}:</td>
</tr>
<tr>
<td>{form type=text name=email maxlength='50' style='width:170px;'}</td>
</tr>
<tr>
<td>{txt key=text_password}:</td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>{form type=password name=password maxlength='30' style='width:80px;'}</td>
<td>{button text=$smarty.const.BUTTON_LOGIN file='login.gif' type='form'}</td>
</tr>
</table></td>
</tr>
<tr>
<td ><div class="hr"></div><a href="{link page='customer' paction='password_reset' conn=SSL}">{txt key=text_link_lostpassword}</a></td>
</tr>
</table>

{form type=formend}
{/if}
</div> [/PHP]

MfG. Hansen

Nochmal PS: Die Nachname-Variable ist richtig nur die Anrede-Variable wird dir das falsche ausgeben.

Link to comment
Share on other sites

Möchte ja nicht ihre wertvolle Zeit für mein Problem beanspruchen, aber könnten Sie mir da eine solche zur Verfügung stellen? Weiß jetzt gerade im Moment gar nicht weiter.

Habe noch folgende Variablen gefunden. Werden in der Bestell Antwort Email Ausgeben.

{$order_data.delivery_firstname} {$order_data.delivery_lastname}

MfG

Patrick

Link to comment
Share on other sites

Probier mal das hier:

{if $addresses.customers_gender =='m'}<p>{txt key=TEXT_MALE} {$addresses.customers_lastname}</p>{/if}

{if $addresses.customers_gender =='f'}<p>{txt key=TEXT_FEMALE} {$addresses.customers_lastname}</p>{/if}

{if $addresses.customers_gender =='c'}<p>{txt key=TEXT_COMPANY_GENDER} {$addresses.customers_company}</p>{/if}

MfG. Hansen

Link to comment
Share on other sites

hier nochmal alles zusammen.

die php Datei:

if(!empty($_SESSION['registered_customer'])){

$customer_data = (get_object_vars($_SESSION['customer']));
$show_box = true;
$status = 1;
$tpl_data = array('customer_data' => $customer_data, 'status' => $status);
}

else{

$show_box = true;
$status = 0;
$tpl_data = array('status' => $status );

}[/PHP]

die html Datei:

[PHP]{if $status == 1}

{assign var=kundenname value=$customer_data.customer_default_address.customers_lastname}

<p>Willkommen
{if $customer_data.customer_default_address.customers_gender == m}
{txt key=TEXT_MALE}
{elseif $customer_data.customer_default_address.customers_gender == f}
{txt key=TEXT_FEMALE}
{elseif $customer_data.customer_default_address.customers_gender == c}
{txt key=TEXT_COMPANY_GENDER}
{if $customer_data.customer_default_address.customers_company != ''}
{assign var=kundenname value=$customer_data.customer_default_address.customers_company}
{/if}
{/if}
{$kundenname}!
{if $customer_data.account_type == 0}
<a href="{link page='customer' conn=SSL}">{txt key=TEXT_ACCOUNT}</a>
{else}
Sie sind als Gast eingeloggt.
{/if}
<a href="{link page='customer' paction='logoff' conn=SSL}">{txt key=TEXT_LOGOFF}</a></p>

{else}
<p>Hallo Gast! Wenn Sie bereits Kunde von uns sind <a href="{link page='customer' paction='login' conn=SSL}">{txt key=TEXT_LOGIN}</a>.</p>

{/if}
[/PHP]

Link to comment
Share on other sites

Probier das bitte nochmal,

wenn das auch nicht hilft könntest du vielleicht nochmal den Inhalt deiner php Datei posten.

<h2 class="boxheader">{txt key=TEXT_BOX_TITLE_LOGIN}</h2>

<div class="boxbody">

{if $registered_customer}

<p>Sie sind angemeldet</p>

{if $addresses.customers_gender =='m'}<p>{txt key=TEXT_MALE} {$addresses.customers_lastname}</p>{/if}

{if $addresses.customers_gender =='f'}<p>{txt key=TEXT_FEMALE} {$addresses.customers_lastname}</p>{/if}

{if $addresses.customers_gender =='c'}<p>{txt key=TEXT_COMPANY_GENDER} {$addresses.customers_company}</p>{/if}


{else}

{form type=form name=create_account action='customer' paction='login' link_params=getParams method=post conn=SSL}

{form type=hidden name=action value=login}

{form type=hidden name=link_target value=index}


<table width="100%"  border="0" cellpadding="0" cellspacing="0">

    <tr>

        <td>{txt key=text_email}:</td>

    </tr>

    <tr>

        <td>{form type=text name=email maxlength='50' style='width:170px;'}</td>

    </tr>

    <tr>

        <td>{txt key=text_password}:</td>

    </tr>

    <tr>

        <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">

          <tr>

            <td>{form type=password name=password maxlength='30' style='width:80px;'}</td>

            <td>{button text=$smarty.const.BUTTON_LOGIN file='login.gif' type='form'}</td>

          </tr>

        </table></td>

    </tr>

    <tr>

      <td ><div class="hr"></div><a href="{link page='customer' paction='password_reset' conn=SSL}">{txt key=text_link_lostpassword}</a></td>

    </tr>

  </table>

  {/if}

{form type=formend}

</div>  

MfG. Hansen

Edit: Baskosehund war schneller

Link to comment
Share on other sites

Vielen Dank für die Mühe von Amilo und Baskosehund !

Das Script von Baskosehund, passt sehr gut. Mit den zusätzlichen Buttons Mein Konto und Abmelden.

Nur Leider habe ich immer noch das Problem das der Vorname und Nachname nicht angezeigt wird, wenn ich eingeloggt bin.

Sollte aber nicht daran liegen das nich noch die 4.0.10 installiert habe und nicht die 4.0.11?

Ansonsten funktioniert das Script 1A

Link to comment
Share on other sites

hy hier mein gesamter inhalt aus der php und html

php

defined('_VALID_CALL') or die('Direct Access is not allowed.');


if(!empty($_SESSION['registered_customer'])){


	$customer_data = (get_object_vars($_SESSION['customer']));

	$customer_data = $customer_data['customer_info'];

	$show_box = true;

	$status = 1;

	$address_data = $_SESSION['customer']->_getAdressList($_SESSION['registered_customer']);

	$tpl_data = array('addresses_data' => $address_data, 'customer_data' => $customer_data, 'status' => $status);

	}


else{


	$show_box = true;

	$status = 0;

	$tpl_data = array('status' => $status  );


}

?>
html
<h2 class="boxheader">{txt key=TEXT_BOX_TITLE_LOGIN}</h2>

<div class="boxbody">

{if $status == 1}


{assign var=kundenname value=$customer_data.customer_default_address.customers_lastname}


<p>Sie sind jetzt angemeldet

{if $customer_data.customer_default_address.customers_gender == m}

    {txt key=TEXT_MALE}

{elseif $customer_data.customer_default_address.customers_gender == f}

    {txt key=TEXT_FEMALE}

{elseif $customer_data.customer_default_address.customers_gender == c}

    {txt key=TEXT_COMPANY_GENDER}

    {if $customer_data.customer_default_address.customers_company != ''}

    {assign var=kundenname value=$customer_data.customer_default_address.customers_company}

    {/if}

  {/if}

{$kundenname}!<br />

{if $customer_data.account_type == 0}

 <a href="{link page='customer' conn=SSL}">{txt key=TEXT_ACCOUNT}</a><br /> 

{else}

Sie sind als Gast eingeloggt.

{/if}<br />

 <a href="{link page='customer' paction='logoff' conn=SSL}">{button text=$smarty.const.BUTTON_LOGOFF file='logoff.gif' type='form'}</a></p>


{else}

{form type=form name=create_account action='customer' paction='login' link_params=getParams method=post conn=SSL}

{form type=hidden name=action value=login}

{form type=hidden name=link_target value=index}


<table width="100%"  border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td>{txt key=text_email}:</td>

	</tr>

	<tr>

		<td>{form type=text name=email maxlength='50' style='width:170px;'}</td>

	</tr>

	<tr>

		<td>{txt key=text_password}:</td>

	</tr>

	<tr>

		<td><table width="100%"  border="0" cellpadding="0" cellspacing="0">

          <tr>

            <td>{form type=password name=password maxlength='30' style='width:80px;'}</td>

            <td>{button text=$smarty.const.BUTTON_LOGIN file='login.gif' type='form'}</td>

          </tr>

        </table></td>

	</tr>

	<tr>

	  <td ><div class="hr"></div><a href="{link page='customer' paction='password_reset' conn=SSL}">{txt key=text_link_lostpassword}</a></td>

    </tr>

  </table>


{form type=formend}

{/if} 

</div>

Link to comment
Share on other sites

Der nachfolgende Bereich ergibt irgendwie keinen Sinn mehr, da du die letzte {else} Abfrage außerhalb der {if} Abfrage hast, welche 3 Zeilen weiter oben geschlossen wird.

{else}

{form type=form name=create_account action='customer' paction='login' link_params=getParams method=post conn=SSL}

{form type=hidden name=action value=login}

{form type=hidden name=link_target value=index}


<table width="100%"  border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td>{txt key=text_email}:</td>

	</tr>

	<tr>

		<td>{form type=text name=email maxlength='50' style='width:170px;'}</td>

	</tr>

	<tr>

		<td>{txt key=text_password}:</td>

	</tr>

	<tr>

		<td><table width="100%"  border="0" cellpadding="0" cellspacing="0">

          <tr>

            <td>{form type=password name=password maxlength='30' style='width:80px;'}</td>

            <td>{button text=$smarty.const.BUTTON_LOGIN file='login.gif' type='form'}</td>

          </tr>

        </table></td>

	</tr>

	<tr>

	  <td ><div class="hr"></div><a href="{link page='customer' paction='password_reset' conn=SSL}">{txt key=text_link_lostpassword}</a></td>

    </tr>

  </table>


{form type=formend}

{/if}

MfG. Hansen

Link to comment
Share on other sites

  • 5 months later...

Also ich hab noch einmal ein paar Änderungen durchgeführt, die ich auch keinem vorenthalten möchte:

loginbox.php (hat sich nicht verändert)


if(!empty($_SESSION['registered_customer'])){

$customer_data = (get_object_vars($_SESSION['customer']));
$show_box = true;
$status = 1;
$tpl_data = array('customer_data' => $customer_data, 'status' => $status);
}

else{

$show_box = true;
$status = 0;
$tpl_data = array('status' => $status );

}
[/PHP]

templatedatei: box_loginbox.html

[PHP]
<h2 class="boxheader">{txt key=TEXT_BOX_TITLE_LOGIN}</h2>
<div class="boxbody">
{if $status == 1}

{assign var=kundennachname value=$customer_data.customer_default_address.customers_lastname}
{assign var=kundenvorname value=$customer_data.customer_default_address.customers_firstname}
<p>Sie sind angemeldet als:<br><b>
{if $customer_data.customer_default_address.customers_gender == m}
{txt key=TEXT_MALE}
{elseif $customer_data.customer_default_address.customers_gender == f}
{txt key=TEXT_FEMALE}
{elseif $customer_data.customer_default_address.customers_gender == c}
{txt key=TEXT_COMPANY_GENDER}
{if $customer_data.customer_default_address.customers_company != ''}
{assign var=kundenname value=$customer_data.customer_default_address.customers_company}
{/if}
{/if}

{$kundenvorname}
{$kundennachname}</b>
{if $customer_data.account_type == 0}

{else}
Sie sind als Gast eingeloggt.
{/if}<br />
<br/>
<a href="{link page='customer' paction='logoff' conn=SSL}">{button text=$smarty.const.TEXT_LOGOFF file='logoff4.gif'}</a></p>

{else}
{form type=form name=create_account action='customer' paction='login' link_params=getParams method=post conn=SSL}
{form type=hidden name=action value=login}
{form type=hidden name=link_target value=index}

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>{txt key=text_email}:</td>
</tr>
<tr>
<td>{form type=text name=email maxlength='50' style='width:170px;'}</td>
</tr>
<tr>
<td>{txt key=text_password}:</td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>{form type=password name=password maxlength='30' style='width:80px;'}</td>
<td>{button text=$smarty.const.BUTTON_LOGIN file='login.gif' type='form'}</td>
</tr>
</table></td>
</tr>
<tr>
<td ><div class="hr"></div><a href="{link page='customer' paction='password_reset' conn=SSL}">{txt key=text_link_lostpassword}</a></td>
</tr>
</table>

{form type=formend}
{/if}
</div>[/PHP]

Getest mit der aktuellsten Version 4.0.12!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...