Pozdrav svima,
trebam pomoć oko podešavanja OC.Trebam napraviti privatni shop i potrebno je da na početnoj stranici bude samo login forma i nakon logiranja preusmjeravanje na početnu stranicu sa proizvodima
Ako netko ima ideju kako to napraviti bio bih jako zahvalan.
Hvala
To bar nije tesko... edituj catalog/controller/common/home.php i proveri da li postoji upisana sesija prijave.. tj da li je korisnik ulogovan... ako jeste prikazes mu katalog,a ko nije prikazes login stranu.. kod bi trebalo da bude nesto nalik ovome:
Code: Select all
<?php
class ControllerCommonHome extends Controller {
public function index() {
if($this->customer->isLogged()){
$this->document->setTitle($this->config->get('config_title'));
$this->document->setDescription($this->config->get('config_meta_description'));
$this->data['heading_title'] = $this->config->get('config_title');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/home.tpl';
} else {
$this->template = 'default/template/common/home.tpl';
}
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
}else{
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/login.tpl')) {
$this->template = $this->config->get('config_template') . '/template/account/login.tpl';
} else {
$this->template = 'default/template/account/login.tpl';
}
$this->children = array(
'common/footer',
'common/header'
);
}
$this->response->setOutput($this->render());
}
}
?>
aha ok... prijavljuje ti gresku oko promenljivih... ajde onda da vidimo ovako sta kaze:
Da li sad radi kako treba?
Code: Select all
<?php
class ControllerCommonHome extends Controller {
public function index() {
if($this->customer->isLogged()){
$this->document->setTitle($this->config->get('config_title'));
$this->document->setDescription($this->config->get('config_meta_description'));
$this->data['heading_title'] = $this->config->get('config_title');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/home.tpl';
} else {
$this->template = 'default/template/common/home.tpl';
}
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
}else{
$this->redirect($this->url->link('account/login', '', 'SSL'));
}
$this->response->setOutput($this->render());
}
}
?>
Who is online
Users browsing this forum: No registered users and 47 guests