Code: Select all
<?php if ($this->customer->isLogged()) { ?>
Welcome <?php echo $this->customer->getFirstName(); ?> <?php echo $this->customer->getLastName(); ?>, Enjoy your stay!
<?php } ?>
It does not need an update, in this section, because this here is the V.1.5.x - Zone.javox wrote:Anyone has any update on this? Looks as if in V2 doesn't work.
OC v.2 is entirely different, it does not even display some WELCOME 'related' Variable, therefore,
any (similar) Welcome Section Content, defined down to the last language File, involved,
would have to be added, to make it work.
Therefore, it must be done another way, to make it work with v.2
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
For 2.0 you need to add it to the controller and set a view variable.
1. EDIT: catalog/controller/common/header.php
2. FIND:
Code: Select all
public function index () {
Code: Select all
if ($this->customer->isLogged()) {
$data['welcome_message'] = sprintf("Welcome %s %s, Enjoy your stay!", $this->customer->getFirstName(), $this->customer->getLastName());
}
5. PUT THIS WHERE YOU WANT IT:
Code: Select all
<?php if (isset($welcome_message)) { echo $welcome_message; } ?>
Code: Select all
public function index() {
if ($this->customer->isLogged()) {
$data['welcome_message'] = sprintf("Welcome %s, Enjoy your stay!", $this->customer->getFirstName());
}
my public function index() { looks like this, and others look like this: public function index () {
now, wich one is written correctly, anyway !?
just to mention it!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
http://www.opencart.com/index.php?route ... n_id=20606
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Have a look at tacfabfashions.com
Qphoria wrote:2.0 doesn't allow direct calls to libraries from the tpl.
For 2.0 you need to add it to the controller and set a view variable.
1. EDIT: catalog/controller/common/header.php
2. FIND:3. AFTER, ADD:Code: Select all
public function index () {
4. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tplCode: Select all
if ($this->customer->isLogged()) { $data['welcome_message'] = sprintf("Welcome %s %s, Enjoy your stay!", $this->customer->getFirstName(), $this->customer->getLastName()); }
5. PUT THIS WHERE YOU WANT IT:Code: Select all
<?php if (isset($welcome_message)) { echo $welcome_message; } ?>
However I have not been able to get it right.
Could you please specify where exactly in header.tpl to put the last piece of code?
What is wrong here, pls advice
EDIT: catalog/controller/common/header.php
2. FIND:
CODE: SELECT ALL
public function index () {
3. AFTER, ADD:
CODE: SELECT ALL
if ($this->customer->isLogged()) {
$data['welcome_message'] = sprintf("Welcome %s %s, Enjoy your stay!", $this->customer->getFirstName(), $this->customer->getLastName());
}
4. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl
5. PUT THIS WHERE YOU WANT IT:
CODE: SELECT ALL
<?php if (isset($welcome_message)) { echo $welcome_message; } ?>
Hi,raptorheli wrote:Done this as described , but it is not working in OC 2.1.0.2
What is wrong here, pls advice
EDIT: catalog/controller/common/header.php
2. FIND:
CODE: SELECT ALL
public function index () {
3. AFTER, ADD:
CODE: SELECT ALL
if ($this->customer->isLogged()) {
$data['welcome_message'] = sprintf("Welcome %s %s, Enjoy your stay!", $this->customer->getFirstName(), $this->customer->getLastName());
}
4. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl
5. PUT THIS WHERE YOU WANT IT:
CODE: SELECT ALL
<?php if (isset($welcome_message)) { echo $welcome_message; } ?>
Add this code in catalog/language/english/common/header.php
Code: Select all
$_['text_logged'] = 'You are logged in as <b><a href="%s">%s</a></b> <b>(</b> <a href="%s">Logout</a> <b>)</b>';
$_['text_welcome'] = 'Welcome visitor you can <a href="%s">login</a> or <a href="%s">create an account</a>.';
$_['text_welcome'] = 'Welcome!';
after ($data['text_shopping_cart'] = $this->language->get('text_shopping_cart');)
Code: Select all
$data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
Code: Select all
<?php if ($logged) { ?>
<?php echo $text_logged; ?>
<?php } else { ?>
<?php echo $text_welcome; ?>
<?php } ?>
Enjoy!
In OC 2.3.2.0, the OcMod Extension exactly matches the Code, and would so function,
at least in an OC Default Theme.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
the Content with an OC v.3.0.2.0, and it should work with a Default Theme.
Good Luck!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Just add below code in catalog/controller/common/header.php
Code: Select all
$data['firstname'] = $this->customer->getFirstName();
$data['lastname'] = $this->customer->getLastName();
Code: Select all
<?php if ( $logged ) { ?>
<span><?php echo $firstname; ?> <?php echo $lastname; ?></span>
<?php } else { ?>
<span>Sign/Register</span>
<?php } ?>
Users browsing this forum: No registered users and 104 guests