Jump to content

Must Be Logged


Recommended Posts

I think you need to use {$logged} variable.

 

Go to themes/default-bootstrap/layout.tpl

 

Replace its' content with

{if $logged}
{assign var='left_column_size' value=0}{assign var='right_column_size' value=0}
{if isset($HOOK_LEFT_COLUMN) && $HOOK_LEFT_COLUMN|trim && !$hide_left_column}{$left_column_size=3}{/if}
{if isset($HOOK_RIGHT_COLUMN) && $HOOK_RIGHT_COLUMN|trim && !$hide_right_column}{$right_column_size=3}{/if}
{if !empty($display_header)}{include file="$tpl_dir./header.tpl" HOOK_HEADER=$HOOK_HEADER}{/if}
{if !empty($template)}{$template}{/if}
{if !empty($display_footer)}{include file="$tpl_dir./footer.tpl"}{/if}
{if !empty($live_edit)}{$live_edit}{/if}
{else}
    {if !empty($display_header)}{include file="$tpl_dir./header.tpl"}{/if}
    {if !empty($display_footer)}{include file="$tpl_dir./authentication.tpl"}{/if}
    {if !empty($display_footer)}{include file="$tpl_dir./footer.tpl"}{/if}
{/if}

If you leave only 

{if !empty($display_footer)}{include file="$tpl_dir./authentication.tpl"}{/if}

in else

 

then there'll be CSS issues (no template). But you can style it as you want.

Edited by electriz (see edit history)
Link to comment
Share on other sites

Here is the more simpler method.

 

Edit /classes/controller/FrontController.php file

 

Search for "parent::init();" without double quotes.

and add below code after parent::init();

 

if((strpos($url,'login')!==false) || (strpos($url,'authentication')!==false))
$page='loginpage';
else
$page='otherpage';
if (!$this->context->customer->isLogged() && $page != 'loginpage')
Tools::redirect('authentication');
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...