Post by OnNets » Sat Sep 10, 2011 2:36 pm

I was playing with carlchen414 and Q's free login module on my opencart v1.5.1.1 and thought that it can be done better by combining the login and account together.

Here's what the sidebox module will be :

When customer not login into account, will show
Image

And when customer login into account, will change to this
Image

Here is a list of things that you must paste or change :

Open catalog/controller/module/account.php

after

Code: Select all

$this->language->load('module/account');
add

Code: Select all

$this->data['heading_title1'] = $this->language->get('heading_title1');
$this->data['entry_email_address'] = $this->language->get('entry_email_address');
$this->data['entry_password'] = $this->language->get('entry_password');
$this->data['button_login'] = $this->language->get('button_login');
$this->data['button_logout'] = $this->language->get('button_logout');
$this->data['button_create'] = $this->language->get('button_create');
$this->id       = 'login';
______________________________________________________________________

Change

Code: Select all

$this->data['login'] = $this->url->link('account/login', '', 'SSL');
To

Code: Select all

$this->data['action'] = $this->url->link('account/login', '', 'SSL');

Open catalog/language/english/module/account.php

After

Code: Select all

$_['heading_title']    = 'Account';
Add

Code: Select all

$_['heading_title1']    = 'Login';
______________________________________________________________________

Before

Code: Select all

?>
Add

Code: Select all

// Entry
$_['entry_email_address']		= 'E-Mail Address:';
$_['entry_password']			= 'Password:';

// Buttons
$_['button_logout']			= 'Logout';
$_['button_create']			= 'Create';

Open catalog/view/theme/default/template/module/account.tpl

Change all to

Code: Select all

<div class="box">
  <div class="box-heading">
      <?php if (!$logged) { ?><?php echo $heading_title1; ?><?php } ?>
      <?php if ($logged) { ?><?php echo $heading_title; ?><?php } ?>
  </div>
  <div class="box-content">

      <?php if (!$logged) { ?>
	<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="module_login"> 
	<b><?php echo $entry_email_address; ?></b><br />
    <span style="text-align: left;"><input type="text" name="email" size="18" /></span>
    <br /><br>
    <b><?php echo $entry_password; ?></b><br />
    <input type="password" name="password" size="18" />
        <br /><br>
    <div style="float:left; text-align: center;"><a onclick="$('#module_login').submit();" class="button"><span><?php echo $button_login; ?></span></a></div>
    <div style="float:right; text-align: center;"><a href="<?php echo $this->url->link('account/login', '', 'SSL');?>" class="button"><span><?php echo $button_create; ?></span></a></div>
    <br style="clear:both;"/>
    </form><br>
      <center><a href="<?php echo $forgotten; ?>"><?php echo $text_forgotten; ?></a></center>
      <?php } ?>
    <ul>
      <?php if ($logged) { ?>
      <li><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a></li>
      <?php if ($logged) { ?>
      <li><a href="<?php echo $edit; ?>"><?php echo $text_edit; ?></a></li>
      <li><a href="<?php echo $password; ?>"><?php echo $text_password; ?></a></li>
      <?php } ?>
      <li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>
      <li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li>
      <li><a href="<?php echo $download; ?>"><?php echo $text_download; ?></a></li>
      <li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li>
      <li><a href="<?php echo $transaction; ?>"><?php echo $text_transaction; ?></a></li>
      <li><a href="<?php echo $newsletter; ?>"><?php echo $text_newsletter; ?></a></li>
      <li><a href="<?php echo $logout; ?>"><?php echo $text_logout; ?></a></li>
      <?php } ?>
    </ul>
  </div>
</div>
That's all and IT ONLY TESTED ON VERSION 1.5.1.1 - ENJOY!

New member

Posts

Joined
Wed Jan 06, 2010 5:53 pm

Post by victor.gatto » Wed Oct 05, 2011 11:18 am

thanks.

Active Member

Posts

Joined
Thu Sep 01, 2011 9:14 am

Post by terrier » Fri Oct 07, 2011 9:44 pm

works great.. thanks

New member

Posts

Joined
Wed Aug 31, 2011 7:05 pm
Who is online

Users browsing this forum: No registered users and 2 guests